Using the C++ Math Library    

Assigning Values to a Cell Array

You put a value into a cell array in much the same way that you read a value out of a cell array. In MATLAB, the only difference between the two operations is the position of the cell array relative to the assignment operator: left of the equal sign (=) means assignment, right of the operator means reference. No matter if you're reading or writing values, the indexing operations you use to specify which values to access remain the same. This is true in the MATLAB C++ Math Library as well.

For example, to assign a vector [1 2 5 7 11] to the contents of the cell (1,2) of N, you write N{1,2} = [1 2 5 7 11] in MATLAB and

in C++ with the MATLAB C++ Math Library.

You could have written the previous assignment in MATLAB as
N(1,2) = { [1 2 5 7 11] }. The corresponding MATLAB C++ Math Library code is:

Because this assignment uses parentheses instead of braces, it is an assignment between cells, which means the source array (on the right-hand side of the assignment operator) must be a cell array as well.


 Indexing Nested Cell Arrays Deleting Elements from a Cell Array