FUNCTION REFERENCE

cell2mat

Convert a cell array of matrices to one matrix.

Convert a cell array of matrices to one matrix.

Syntax

M = cell2mat(C)

Concatenates the contents of C: each row of cells side by side, then the rows

on top of each other. All contents must have the same class (double, logical,

char or struct), and the pieces must fit together. An empty cell gives [].

Example

cell2mat({[1 2], 3; [4 5], 6})   % [1 2 3; 4 5 6]

Differences from MATLAB: 2-D cell arrays only. Error messages match MATLAB's.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.