RESIZE Resizing an Array

Section: Array Generation and Manipulations

Usage

Arrays in FreeMat will resize themselves automatically as required in order to accomodate assignments. The rules for resizing are as follows. If an assignment is made to an n-dimensional array (where n >= 2) that is outside the current dimension bounds of the array, then the array is zero padded until the it is large enough for the assignment to work. If the array is a scalar, and an assignment is made to the non-unity element, such as:
a = 1;
a(3) = 4;

then the result will be a row vector (in this case, of size 3). Row and column vectors will be resized so as to preserve their orientation. And if an n-dimensional array is forced to resize using the vector notation, then the result is a row vector.