| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
| On this page… |
|---|
Assigning Values to a Cell Array Returning Data from a Cell Array Using Cell Arrays with Functions |
A cell array is a collection of containers called cells in which you can store different types of data. The figure shown below represents a 2-by-3 cell array. The cells in row one hold an array of unsigned integers, an array of strings, and an array of complex numbers. Row two holds three other types of arrays, the last being a second cell array nested in the outer one:

Each cell of a cell array contains some type of MATLAB array. The data in this array can belong to any one MATLAB or user-defined class, and can have any valid array dimensions; this includes 1-by-1 (a scalar array), or having one or more dimension equal to zero (an empty array). A second cell of the same array can belong to an entirely different class, and can also have different dimensions than the first. The capability to store arrays of mixed classes and sizes is the most significant feature of a cell array. Another common use of cell arrays is to store character strings that are of unequal length. A cell array that is used for this purpose is called a cell array of strings.
Like all MATLAB arrays, cell arrays must be rectangular in shape. That is, the length of all rows must be the same, the length of all columns the same, and so on for every dimension of the array.
In many respects, cell arrays are quite similar to struct arrays. See Comparing Struct Arrays with Cell Arrays for help in deciding which of these two classes best suits the needs of your applications.
This table shows the operators used in creating, concatenating, and indexing into the cells of a cell array.
| Operation | Syntax | Description |
|---|---|---|
| Creating | C = {A B D E} | Builds a cell array C that can contain data of unlike types in A, B, D, and E. |
| Concatenating | C3 = {C1 C2} | Concatenates cell arrays C1 and C2 into a two-element cell array C3 such that C3{1} = C1 and C3{2} = C2. |
| C3 = [C1 C2] | Concatenates the contents of cell arrays C1 and C2, assuming that the dimensions of these arrays are compatible. | |
| Indexing | X = C(s) | Returns the cells of array C that are specified by subscripts s. |
| X = C{s} | Returns the contents of the cells of C that are specified by subscripts s. | |
| X = C{s}(t) | References one or more elements of an array that resides within a cell. Subscript s selects the cell, and subscript t selects the array element(s). |
For more information on these operations, see Creating a Cell Array, Concatenating Cell Arrays, and Indexing into a Cell Array, respectively.
Creating cell arrays in MATLAB is similar to creating arrays of other MATLAB classes like double, char, and so on. The main difference is that, when creating a cell array, you enclose the array contents or indices with curly braces { } instead of square brackets [ ]. The curly braces are cell array constructors, just as square brackets are numeric array constructors. Use commas or spaces to separate elements and semicolons to terminate each row.
For example, to create a 2-by-2 cell array A, type
A = {[1 4 3; 0 5 8; 7 2 9], 'Anne Smith'; 3+7i, -pi:pi/4:pi};
This results in the array shown below.

Note The curly braces operator creates two-dimensional matrices only, (including 0-by-0, 1-by-1, and 1-by-n matrices). To create cell arrays of more than two dimensions, see Creating Multidimensional Arrays. |
To nest one cell array within another, enclose both inner and outer cell arrays with the curly braces { }. The example shown here nests a cell array of vital signs inside a cell array of a person's medical record. (Defining the columns with a header is not usually required, and is just used here to make the example simpler):
header = {'Name', 'Age', 'Pulse/Temp/BP'};
records(1,:) = {'Kelly', 49, {58, 98.3, [103, 72]}};
header, records
header =
'Name' 'Age' 'Pulse/Temp/BP'
records =
'Kelly' [49] {1x3 cell}It is often easier to build a nested cell array in steps. The example below creates the inner cell array, vitalsigns, first. The second statement then uses the vitalsigns array in creating the outer cell array, records:
vitalsigns = {60, 98.4, [105, 75]};
records(1,:) = {'Kelly', 49, vitalsigns}
record =
'Name' 'Age' 'Pulse/Temp/BP'
'Kelly' [ 49] {1x3 cell}Verify the new values in the records cell array:
fprintf('pulse: %d temp: %3.1f bp: %d/%d\n', ...
records{3}{:})
pulse: 60 temp: 98.4 bp: 105/75
You also can create a cell array one cell at a time by using multiple assignment statements. MATLAB expands the size of the cell array with each assignment statement:
A(1,1) = {[1 4 3; 0 5 8; 7 2 9]};
A(1,2) = {'Anne Smith'};
A(2,1) = {3+7i};
A(2,2) = {-pi:pi/4:pi};If you assign data to a cell that is outside the dimensions of the current array, MATLAB automatically expands the array to include the subscripts you specify. It fills any intervening cells with empty matrices. For example, the assignment below turns the 2-by-2 cell array A into a 3-by-3 cell array:
A(3,3) = {5};3–by-3 Cell Array

Note If you already have a numeric array of a given name, don't try to create a cell array of the same name by assignment without first clearing the numeric array. If you do not clear the numeric array, MATLAB assumes that you are trying to mix cell and numeric syntaxes, and generates an error. Similarly, MATLAB does not clear a cell array when you make a single assignment to it. If any of the examples in this section give unexpected results, clear the cell array from the workspace and try again. |
Handling Unassigned Cells. To keep all dimensions of a cell array even, MATLAB automatically fills in any unassigned cells as you build the cell array. For example, if you have a cell array that consists of a row of three elements, and you add one new cell to a second row, MATLAB adds two cells to the new row to keep all rows at the same length. The values of these two cells are set to the empty array []. This is called scalar expansion.
MATLAB handles other array types in a similar manner, except that it sets unassigned elements to zero instead of the empty array. This example adds a single element to a 1-by-3 array of type double, and then does the same to a cell array:
A = [2 4 6]; A(2,1) = 8
A =
2 4 6
8 0 0
C = {2 4 6}; C(2,1) = {8}
C =
[2] [4] [6]
[8] [] []When assigning values to a cell array, either of the syntaxes shown below is valid. You can use the braces on the right side of the equation, enclosing the value being assigned, as shown here:
A(1,1) = {[1 4 3; 0 5 8; 7 2 9]};
A(1,2) = {'Anne Smith'};You can also use them on the left side, enclosing the array subscripts:
A{1,1} = [1 4 3; 0 5 8; 7 2 9];
A{1,2} = 'Anne Smith';MATLAB stores internal information for a cell array in a contiguous segment of memory called a header. If you increase the number of cells in a cell array over time, the size of the header also grows, thus using more of this segment in memory. This can eventually lead to "out of memory" errors.
If you can roughly estimate the dimensions of a cell array at the time you create it, you can preallocate the necessary space in memory and help to avoid this type of problem. See the documentation on Data Structures and Memory to help you make this estimate.
Note Unlike the internal header information of a cell array, the memory consumed by the data stored in a cell array is not contiguous. While preallocating memory can help avoid memory problems when increasing the dimensions of a cell array, it does not protect against shortages in memory due to the amount of data you store in the array. Even with preallocated cell (and struct) arrays, you need to take precautions against using more memory than is available. |
How to Preallocate Memory. To allocate memory for a 25-by-50 cell array and initialize the entire array to [], use either of the following two methods:
C = cell(25,50);
C{25,50} = [];After the memory has been allocated, you can begin to construct the array by assigning data to it.
There are two ways that you can create a new cell array from existing cell arrays:
Concatenate entire cell arrays to individual cells of the new array. For example, join three cell arrays together to build a new cell array having three elements, each containing a cell array. This method uses the curly brace { } operator.
Concatenate the contents of the cells into a new array. For example, join cell arrays of size m-by-n1, m-by-n2, and m-by-n3 together to yield a new cell array that is m-by-(n1+n2+n3) in size. This method uses the square bracket [ ] operator.
Here is an example. First, create three 3-row cell arrays of different widths:
C1 = {'Jan' 'Feb'; '10' '17'; uint16(2004) uint16(2001)};
C2 = {'Mar' 'Apr' 'May'; '31' '2' '10'; ...
uint16(2006) uint16(2005) uint16(1994)};
C3 = {'Jun'; '23'; uint16(2002)};
This creates arrays C1, C2, and C3:
C1 C2 C3 'Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' '10' '17' '31' '2' '10' '23' [2004] [2001] [2006] [2005] [1994] [2002]
Use the curly brace operator to concatenate entire cell arrays, thus building a 1-by-3 cell array from the three initial arrays. Each cell of this new array holds its own cell array:
C4 = {C1 C2 C3}
C4 =
{3x2 cell} {3x3 cell} {3x1 cell}Now use the square bracket operator on the same combination of cell arrays. This time MATLAB concatenates the contents of the cells together and produces a 3-by-6 cell array:
C5 = [C1 C2 C3]
C5 =
'Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun'
'10' '17' '31' '2' '10' '23'
[2004] [2001] [2006] [2005] [1994] [2002]Note The notation {} denotes the empty cell array, just as [] denotes the empty matrix for numeric arrays. You can use the empty cell array in any cell array assignments. |
When working with cell arrays, you have a choice of selecting entire cells of an array to work with, or the contents of those cells. The first method is cell indexing, the second is content indexing:
Cell indexing enables you to work with whole cells of an array. You can access single or multiple cells within the array, but you cannot select anything less than the complete cell. If you want to manipulate the cells of an array without regard to the contents of those cells, use cell indexing. This type of indexing is denoted by the parentheses operator ( ).
Use cell indexing to assign any set of cells to another variable, creating a new cell array.
Creating a New Cell Array from an Existing One

Content indexing gives you access to the contents of a cell. You can work with individual elements of an array within a cell, but you can only do so for one cell at a time. This indexing uses the curly brace operator { }.
Note The examples in this section focus on two-dimensional cell arrays. For examples of higher-dimension cell arrays, see Multidimensional Arrays. |
This example shows how to use cell and content indexing. Start out by creating the following 3-by-3 cell array. The third element of each row is a nested cell array:
header = {'Name', 'Age', 'Pulse/Temp/BP'};
records(1,:) = {'Kelly', 49, {58, 98.3, [103, 72]}};
records(2,:) = {'Mark', 25, {60, 98.6, [105, 75]}};
records(3,:) = {'Susan', 32, {71, 99.1, [110, 78]}};
Display the contents of the cell array. Defining the columns with a header is not usually required, and is just used here to make the example simpler:
header =
'Name' 'Age' 'Pulse/Temp/BP'
records =
'Kelly' [49] {1x3 cell}
'Mark' [25] {1x3 cell}
'Susan' [32] {1x3 cell}
Use content indexing (curly braces) to change one of the names. Content indexing gives you access to what is contained within the cells of the array:
records{3,1}='Susanne'
records =
'Kelly' [49] {1x3 cell}
'Mark' [25] {1x3 cell}
'Susanne' [32] {1x3 cell}
Use cell indexing (parentheses) to delete an entire row. (You delete part of a cell array by assigning the empty array [] to it.) Cell indexing is appropriate here because you do not need access to the contents of the row:
records(1,:) = []
records =
'Mark' [25] {1x3 cell}
'Susanne' [32] {1x3 cell}
The cells of a cell array contain arrays of standard MATLAB data types. These arrays use the indexing syntax appropriate to the class of the array. The table below shows examples of statements that use a combination of cell and struct array indexing:
| Action | Required Indexing |
|---|---|
| Access an element of an array in a cell of cell array C. | C{3,15}(5,25) |
| Access an element of array A, where A is a field of a structure that resides in cell array C. | C{3,15}.A(5,20) |
| Access an element of an array that resides in a nested cell array. | C{3,15}{5,20}(50,5) |
| Access an element of array B, where B is a field of structure A, and A is a field of a structure that resides in cell array C. | C{3,15}.A(5,20).B(50,5) |
| Access an element of cell array B, where B is a field of a structure that resides in cell array C. | C{3,15}.B{5,20} |
Start this example by creating the records cell array taken from the example in the previous section:
records(1,:) = {'Kelly', 49, {58, 98.3, [103, 72]}};
records(2,:) = {'Mark', 25, {60, 98.6, [105, 75]}};
records(3,:) = {'Susan', 32, {71, 99.1, [110, 78]}};
Display information from cells in the nested cell array. This requires two adjacent expressions of content indexing, {2,3}{3}:
fprintf('Name: %s Systolic: %d Diastolic: %d\n', ...
records{2,1}, records{2,3}{3})
Name: Mark Systolic: 105 Diastolic: 75
You can index into a nested array in stages rather than all at once. Consider breaking down this indexing expression
C{5,3}{4,7}(:,4)into the following:
x = C{5,3}; % x is a cell array
y = x{4,7}; % y is also a cell array
z = y(:,4) % z is a standard arraySee the section on Indexing Tips in the documentation on "Structures" for indexing tips that apply to both the cell and struct classes.
If you want both the numeric indexing of cell arrays and the named containers of structures, you can combine the two to some extent by implementing cell array indexing with a MATLAB Map object (see Map Containers). The Map object provides a translation from a name string to a numeric array index. This implementation has the advantage of using less memory than a struct or cell array, but has the disadvantage of being slower.
The example shown here demonstrates the use of a Map object in locating information in a cell array. Note that the names given to the keys of a Map object do not have to adhere to the rules for variable names. In this example, each of the key names contain a space character. This is not allowed in variable names:
redSoxStats(57:60,1:4) = { ...
%
% AtBat Runs Hits HR
%
653, 118, 213, 17; ... % Pedroia
554, 98, 155, 9; ... % Ellsbury
538, 91, 168, 29; ... % Youkilis
423, 37, 93, 13}; ... % Varitek
m1 = containers.Map({'Dustin Pedroia','Jacoby Ellsbury', ...
'Kevin Youkilis', 'Jason Varitek'}, {57,58,59,60});
m2 = containers.Map({'AtBat','Runs','Hits', 'HR'}, ...
{1,2,3,4});
player = 'Dustin Pedroia';
fprintf( ...
'\n %s had %d At Bats and %d hits this season.\n', ...
player, redSoxStats{m1(player), m2('AtBat')}, ...
redSoxStats{m1(player), m2('Hits')})
Dustin Pedroia had 653 At Bats and 213 hits in the 2008 season.Use the curly brace { } operator on the right side of the statement to assign values to a cell array:
To store four values in a 2-by-2 cell array, use
C = {magic(5), 'Hello'; uint8(100), [1:3:19]}
C =
[5x5 double] 'Hello'
[ 100] [1x7 double]The following commands place the values into different cells of cell array C:
clear C
C(3,1:4) = {magic(5), 'Hello', uint8(100), [1:3:19]}
C =
[] [] [] []
[] [] [] []
[5x5 double] 'Hello' [100] [1x7 double]
clear C
C(2:3,5:6) = {magic(5), 'Hello'; uint8(100), [1:3:19]}
C =
[] [] [] [] [] []
[] [] [] [] [5x5 double] [ 100]
[] [] [] [] 'Hello' [1x7 double]The deal function offers an alternative method of writing to the cell array. These two statements produce the same result as the statements shown above that use the curly braces { } operator:
[C{3,1:4}] = deal(magic(5), 'Hello', uint8(100), [1:3:19]);
[C{2:3,5:6}] = deal(magic(5), 'Hello', uint8(100), [1:3:19]);
This section describes the syntax to use to have MATLAB return data from a cell array, how to assign data from a cell array to a comma-separated list or separate output variables, and also how to plot the contents of a cell array.
The following table shows a number of different ways of returning data from a cell array. The variable c is a 3x4 cell array in which each cell contains a 2x5 array of class double.
| Values to be acquired | MATLAB Statement | Data Structure Returned |
|---|---|---|
| Top level of cell array c | c | 3x4 cell array. |
| Top level of cell array c, as a vector | c(:) | 12x1 cell array. |
| Selected cells in cell array c | c(2:3,1:3) | 2x3 cell array. |
| Full contents of one cell in cell array c. | c{2,3} | 2x5 array of double. |
| Full contents of selected cells in cell array c. | c{2:3,3:4} | 4-item comma-separated list of 2x5 double. |
| Full contents of all cells in cell array c. | c{:} | 12-item comma-separated list of 2x5 double. |
| Selected elements of one cell in cell array c. You cannot use multiple elements of c with this syntax. | c{3,4}(2,3:5) | 1x3 array of double. |
The first three of these indexing expressions provide no access to individual elements of the cells. You could use these expressions to copy, rearrange, or delete parts of the cell array.
Accessing a single value from one cell of a cell array is no different from accessing one of the elements of any other MATLAB data type. Accessing multiple elements, however, can be quite different. Multiple elements of a cell array cannot be assigned to a single variable because they do not necessarily belong to the same class. Instead, MATLAB assigns values from a cell array to a series of separate variables called a comma-separated list. Here is an example of such a list:
First, create a 3-by-3 cell array called records:
records(1,:) = {'Kelly', 49, {58, 98.3, [103, 72]}};
records(2,:) = {'Mark', 25, {60, 98.6, [105, 75]}};
records(3,:) = {'Susan', 32, {71, 99.1, [110, 78]}};
Displaying one column of the cell array causes MATLAB to return three separate values, each, in succession, assigned to the ans variable:
records{:,2}
ans =
49
ans =
25
ans =
32The potential problem with this type of output is that MATLAB overwrites the ans variable for each value returned. If you only want to display these values, then this command should suit your purpose. The next section shows how to assign to variables that you can reuse.
If you were to assign multiple elements of a cell array to just one variable, MATLAB uses that variable to return the first value, but is unable to return all values of the array:
x = records{:,2}
x =
49If you know how many values there are in the cell array elements you are trying to access, then you can provide that many outputs in the command, as shown here:
[v1 v2 v3] = records{:,1}
v1 =
Kelly
v2 =
Mark
v3 =
SusanAs in the previous example, this is a comma-separated list. As you can see here, each return variable adopts the class and size of the cell array element assigned to it:
whos v1 Name Size Bytes Class Attributes v1 1x5 10 char whos v2 Name Size Bytes Class Attributes v2 1x4 8 char
For a high-level graphical display of cell architecture, use the cellplot function. Consider a 2-by-2 cell array containing two text strings, a matrix, and a vector:
c{1,1} = '2-by-2';
c{1,2} = 'eigenvalues of eye(2)';
c{2,1} = eye(2);
c{2,2} = eig(eye(2));The command cellplot(c) produces this figure.

This section describes how to apply a function to data contained within a cell array using the cellfun function, and also how to pass arguments to and from a function using cell arrays.
Use the cellfun function to run a function on each field of a scalar cell array. This example runs an anonymous function on a cell array containing the days of a week. The anonymous function, @(x)x(1:3), shortens each string to its first three characters. The function reference page for cellfun explains the use of the UniformOutput option:
days{1} = 'Sunday'; days{2} = 'Monday';
days{3} = 'Tuesday'; days{4} = 'Wednesday';
days{5} = 'Thursday'; days{6} = 'Friday';
days{7} = 'Saturday';
shortNames = cellfun(@(x)x(1:3), days, 'UniformOutput', false)
shortNames =
'Sun' 'Mon' 'Tue' 'Wed' 'Thu' 'Fri' 'Sat'
See the reference page for cellfun for additional help on using this function.
You can call a function with variable numbers of input or output arguments by using the terms varargin and varargout in the respective input and output argument lists for that function. The function being called provides access to these arguments using cell arrays named varargin and varargout. See Passing Variable Numbers of Arguments in the documentation on "Functions and Scripts".
A simple and easily maintainable way to pass arguments to or from a function is to package them in a cell array, and then pass the entire cell array to the function. This example passes information pertaining to four United States presidents to the function showPresInfo:
USPres = cell(30,3); % Allocate memory for the array.
USPres{27,1} = 'William Howard Taft'; % 27th US President
USPres{27,2} = [1909, 1913]; % Term
USPres{27,3} = 'James S. Sherman'; % Vice President
USPres{28,1} = 'Woodrow Wilson'; % 28th
USPres{28,2} = [1913, 1921];
USPres{28,3} = 'Thomas R. Marshall';
USPres{29,1} = 'Warren G. Harding'; % 29th
USPres{29,2} = [1921, 1923];
USPres{29,3} = 'Calvin Coolidge';
USPres{30,1} = 'Calvin Coolidge'; % 30th
USPres{30,2} = [1923, 1929];
USPres{30,3} = 'Charles Dawes';
Write a short program to display the information passed in:
function showPresInfo(number, info) info(number-26, :)'
Call this program, passing rows 27 through 30 of the cell array:
showPresInfo(29, USPres(27:30, :))
ans =
'Warren G. Harding'
[1x2 double]
'Calvin Coolidge'You can also pass selected cells of a cell array in a function call. This example passes the names of the four Vice Presidents in the form of a comma-separated list. In this case, the function being called, showVPInfo, receives these strings as four separate input arguments:
The value passed to this function is a list of four separate items:
USPres(27:30).vp
ans =
James S. Sherman
ans =
Thomas R. Marshall
ans =
Calvin Coolidge
ans =
Charles Dawes
Write a short program that displays the name of a selected Vice President. Use the varargin function to accept and unpack the four separate input arguments generated by the USPres{27:30,3} input:
function showVPInfo(number, varargin)
str = ['The Vice President who served with ', ...
'the %dth US President was %s\n'];
fprintf(str, number, varargin{number-26})Run the program a couple of times to verify that the names of more than one Vice Presidents were passed:
showVPInfo(28, USPres{27:30,3})
The Vice President who served with the 28th US President was
Thomas R. Marshall
showVPInfo(30, USPres{27:30,3})
The Vice President who served with the 30th US President was
Charles DawesThe cell2struct function converts a cell array to a struct array. The statement
s = cell2struct(c,f,d)
converts a cell array c into a struct array s having the fields named in f and based on the d axis of the input cell array.
The struct2cell function converts a structure array to a cell array. The statement
c = struct2cell(s)
converts an m-by-n structure s that has p fields into a p-by-m-by-n cell array c:
This example converts a 4-by-1-by-2 cell array USPres_c1 to a 1-by-2 struct array USPres_s1 with four fields, and then back to a cell array USPres_c2 that is equal to the original.
Create the original cell array:
USPres_c1{1,1,1} = 'Franklin D. Roosevelt';
USPres_c1{2,1,1} = 'Democratic';
USPres_c1{3,1,1} = [1933, 1945];
USPres_c1{4,1,1} = ...
{'John Garner';'Henry Wallace';'Harry S Truman'};
USPres_c1{1,1,2} = 'Harry S Truman';
USPres_c1{2,1,2} = 'Democratic';
USPres_c1{3,1,2} = [1945, 1953];
USPres_c1{4,1,2} = {'Alben Barkley'};
whos USPres_c1
Name Size Bytes Class Attributes
USPres_c1 4x1x2 964 cellConvert the cell array to a struct array:
USPres_s1 = cell2struct(USPres_c1, ...
{'name','party','term','vp'}, 1);
whos USPres_s1
Name Size Bytes Class Attributes
USPres_s1 1x2 1220 structConvert back to a cell array and compare it with the original:
USPres_c2 = struct2cell(USPres_s1);
whos USPres_c2
Name Size Bytes Class Attributes
USPres_c2 4x1x2 964 cell
isequal(USPres_c1, USPres_c2)
ans =
1This section summarizes the following types of operators that work with cell arrays:
| Syntax | Description |
|---|---|
| C = {A B D E} | Builds a cell array C that can contain data of unlike types in A, B, D, and E. |
| Syntax | Description |
|---|---|
| C3 = {C1 C2} | Concatenates cell arrays C1 and C2 into a two-element cell array C3, such that C3{1} = C1 and C3{2} = C2. |
| C3 = [C1 C2] | Concatenates the contents of cell arrays C1 and C2 into a new cell array with length(C3)==length(C1)+length(C2). |
| Syntax | Description |
|---|---|
| X = C(s) | Returns the cells of array C that are specified by subscripts s. |
| X = C{s} | Returns the contents of the cells of C that are specified by subscripts s. |
| X = C{s}(v) | References one or more elements of an array that resides within a cell. Subscript s selects the single cell, and subscript v selects the array element(s). |
| X = C{s1}{s2} | Returns the contents of a nested cell array. Subscripts for the outer array C are s1. These subscripts can only refer to one cell of the outer array. Subscripts for the inner cell array are s2. |
| X = C{s1}{s2}(v) | Returns one or more elements of an array that reside in a nested cell array. |
| X = C{s}(t).f(v) | Returns one or more elements of an array that reside in a struct field, where the struct resides in a cell of cell array C. Subscripts are s for the cell array, t for the struct array, and v for the lowest-level array. |
This section summarizes the following types functions that work with cell arrays:
| Function | Description |
|---|---|
| cat | Concatenate arrays along specified dimension. |
| cell | Create cell array. |
| horzcat | Concatenate arrays horizontally. |
| length | Length of array. |
| ndims | Number of array dimensions. |
| numel | Number of elements in array or subscripted array expression. |
| repmat | Replicate and tile array. |
| reshape | Reshape array. |
| size | Size of array. |
| vertcat | Concatenate arrays vertically. |
| Function | Description |
|---|---|
| cell2struct | Convert cell array to structure array. |
| class | Create object or return class of object. |
| iscell | Determine whether input is cell array. |
| struct2cell | Convert structure to cell array. |
| whos | List variables in workspace. |
| Function | Description |
|---|---|
| celldisp | Display cell array contents. |
| cellplot | Display a graphical depiction of a cell array. |
| deal | Copy input to separate outputs. |
| Function | Description |
|---|---|
| cellfun | Apply function to each field of scalar cell array. |
| varargin | Variable length input argument list. |
| varargout | Variable length output argument list. |
| Function | Description |
|---|---|
| cell2struct | Convert cell array into struct array. |
| struct2cell | Convert struct array into cell array. |
| mat2cell | Divide matrix into cell array of matrices |
| cell2mat | Convert cell array of matrices to single matrix |
| num2cell | Convert numeric array to cell array |
![]() | Structures | Function Handles | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |