See other catalogues for
The MathWorks
You may also be interested in
Text version of the page
| | | | | | | | | | | | | | | | |
| | | |
| | | Other Data Structures | | |
| | | |
| | | is a 1-by-4-by-24 array containing 24 copies of the row vector 34 34 34 34 and sum(M,2) is a 4-by-1-by-24 array containing 24 copies ofthe column vector 34 34 34 34 Finally, S = sum(M,3) adds the 24 matrices in the sequence. The result has size 4-by-4-by-1, so it looks like a 4-by-4 array: S = | | |
| | | |
| | | 204 204 204 204 204 204 204 204 204 204 204 204 | | 204 204 204 204 | | |
| | | |
| | | Cell Arrays Cell arrays in MATLAB are multidimensional arrays whose elements are copies of other arrays. A cell array of empty matrices can be created with the cell function. But, more often, cell arrays are created by enclosing a miscellaneous collection of things in curly braces, {}. The curly braces are also used with subscripts to access the contents ofvarious cells. For example, C = {A sum(A) prod(prod(A))} produces a 1-by-3 cell array. The three cells contain the magic square, the row vector of column sums, and the product of all its elements. When C is displayed, you see | | |
| | | |
| | | C= | |
| | | |
| | | 4-11 | | |
| | | |
| | | | | | | | | | | | | | | | |