stack

Modified: 2010/07/19 00:30 by TheWizEd - Categorized as: English
stack(...) - Stack function

Returns an vector or matrix formed by placing arguments top to bottom. Arguments are arrays having the same number of columns or they are scalars and column vectors.

In the case of scalar values the stack function returns a column vector containing the list of arguments.

stack1

In the next example three column vectors a, b, and c are input as arguments to the stack function.

stack2

In order to obtain a matrix the vectors must be in row order. The three row vectors d, f, and g are input as arguments to the stack function.

stack3

The row vectors can easily be translated to columns in the matrix by applying the matrix transpose to the stack function.

stack4

See also augment

Return to Functions page

ScrewTurn Wiki version 2.0.37. Some of the icons created by FamFamFam.