Cell

2 ビュー (過去 30 日間)
Gal
Gal 2012 年 6 月 27 日
How do i define a cell array in Matlab?

回答 (3 件)

Thomas
Thomas 2012 年 6 月 27 日
  1 件のコメント
Jan
Jan 2012 年 6 月 27 日
Or locally in your Matlab session:
help cell
doc cell

サインインしてコメントする。


Jonathan
Jonathan 2012 年 6 月 27 日
You can use the cell function, for example: C = cell(3,4,2) OR you can use the {} operator, for example: C{3,4,2} = [ ]. Both methods produce a cell array with each cell containing an empty, 0-by-0 array of type double.

Jonathan
Jonathan 2012 年 6 月 27 日
Creating cell arrays in MATLAB is similar to creating arrays of other MATLAB data types like double, character, etc. The main difference is that, when constructing 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};

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by