how to store the matrix value in cell array?

I have matrix C=100 by 10 and I want to store the values of matrix in cell array. The code is not working. Please help me on this
T3=cell(1,10);
for k1=1:n
T3(k1)=C;
end

 採用された回答

Stephen23
Stephen23 2020 年 9 月 15 日
編集済み: Stephen23 2020 年 9 月 15 日

1 投票

If C is a matrix, then you need to use curly braces to access the contents of the cell array T3:
T3 = cell(1,10);
for k1 = 1:n
T3{k1} = C;
end % ^ ^ curly braces
The difference is very simple:
  • () parentheses refer to the cells themselves,
  • {} curly braces refer to the cell contents.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

質問済み:

AS
2020 年 9 月 15 日

編集済み:

2020 年 9 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by