# General Toolbox for Matlab®

## written by: Liran Carmel

A collection of general purpose functions of broad applicability that form an infrastructure for other toolboxes. These functions accept standard arguments as inputs, and produce standard arguments as outputs, thus making no use of objects defined in my other toolboxes.

#### Coloring and colormaps:

bw
black/white colormap.
microarraycolormap
gene expression colormap (© Michael Driscoll, Liran Carmel)
real2rgb
turns a real representation of colors into RGB.

#### Combinatorial Algorithms:

ksubset2lexrank
finds the lexicographic rank of a k-subset T.
lexrank2ksubset
finds the k-subset T from (1,...,n) whose rank is {r}.
lexrank2subset
finds the subset T \in (1,...,n) whose rank is {r}.
subset2lexrank
finds the lexicographic rank of a subset T \in (1,...,n).

#### Data manipulations:

categorize
turns continuous data into categorized one.
transform
transforms multivariate data.

#### Display:

sets up a line with changing content.
dispchangingcontentupdate
dispstr
displays string array with line numbering.
disptext
displays long text in multiple lines, possibly indented.
subfuns
lists all functions in specified MFILE (© 2004 The MathWorks)

#### Excel manipulations:

collett2num
finds the column number that fits a certain string.
colnum2lett
finds the letter combination that fits a certain number.
rangeparts
breaks an excell cell name into its row and column parts.

#### Information extraction:

all2
returns 1 if all elements in matrix X are true.
any2
returns 1 if any element in matrix X is true.
max2
returnes the maximal element in a matrix.
min2
returnes the minimal element in a matrix.
minmax
calculate the minimal and maximal values of given data.
monotonicity
checks the monotonicity status between two functions.
nangeomean
computes geometrical mean, ignoring NaNs.
sum2
returnes the sum of all elements of a matrix.

#### Linear algebra:

reduce2subspace
reduces vectors or matrices to subspace.

#### Random numbers:

randindex
randomly picks one from a group of indices.
randnp
draws random variables from a p-dimensional normal distribution.
randorder
randomly permutes the elements of any array.

#### String manipulations:

fitint
prints an integer with preceding zeros.
fitword
puts a word in the center of a prespecified space.
num2count
gives counting text coressponding to a number.
num2width
width (in characters) required to display {num}.
reblank
removes leading spaces from a string.
str2keyword
extracts unique identifier of reserved keywords.
strtokl
finds the last token in a string
strtokn
finds the n'th token in a string

#### Variable verification:

nodims
finds the true" number of dimensions of an array.

#### Vector manipulations:

allbut
produces a vector of successive integers, missing specific ones.
forcerow
ensures that a vector is a row-vector.
unit
returnes the unit vector.

#### Visualization:

confplot
plot with continuous confidence boundaries (© Michele Giugliano)
ellipse
generate the coordinates of rotated and translated ellipse.
horizline
draws black horizontal line on current axes.
makex
generates x-vector for a given y-vector.
maximize
resize a figure to fill the screen (© Yuval Cohen)
pseudocolor
pseudoclor map of a matrix.
save2word
saves plots to Microsoft Word (© Suresh E. Joel).
showaxes
draws the two axes in solid black line.
vertline
draws black vertical line on current axes.

#### Workspace manipulations:

clean
resets the workspace.
num2clip
copies a numerical-array to the clipboard (© Grigor Browning)

The toolbox is freely available from this site. The latest release is General_13Sep2010.
Prerequisite: None.