Section: Variables and Arrays
C
, it is the equivalent to the
void *
array. The general syntax for their construction is
A = {row_def1;row_def2;...;row_defN}
where each row consists of one or more elements, seperated by commas
row_defi = element_i1,element_i2,...,element_iM
Each element can be any type of FreeMat variable, including matrices, arrays, cell-arrays, structures, strings, etc. The restriction on the definition is that each row must have the same number of elements in it.
--> A = {14,'hello',[1:10]} A = [14] ['hello'] [[1 10] int32]
Note that in the output, the number and string are explicitly printed, but the array is summarized. We can create a 2-dimensional cell-array by adding another row definition
--> B = {pi,i;e,-1} B = [3.14159] [0+1i] [2.71828] [-1]
Finally, we create a new cell array by placing A
and B
together
--> C = {A,B} C = {[1 3] cell } {[2 2] cell }