フィルターのクリア

how to convert a matrix to a cell array

110 ビュー (過去 30 日間)
John
John 2012 年 7 月 30 日
コメント済み: william katzianer 2020 年 7 月 21 日
Hi there,
I have a 2x10 matrix. Would anybody know how I could convert it into a 1x10 cell array - so that each cell contains a 2x1 matrix?
I'm new to matlab and would appreciate any help.
Kind Regards
John

採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 7 月 30 日
編集済み: Andrei Bobrov 2012 年 7 月 30 日
please read about functions num2cell and mat2cell
eg:
out = num2cell(yourmatrix,1)
or
out = mat2cell(yourmatrix,2,ones(1,size(yourmatrix,2)))
  1 件のコメント
Raphael
Raphael 2013 年 5 月 17 日
Dear,
Do you know how to save the cell array created by the function?
Best regards,
Raphael

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

その他の回答 (1 件)

venkat vasu
venkat vasu 2012 年 7 月 30 日
編集済み: Walter Roberson 2012 年 7 月 30 日
X= reshape(1:20,2,10)'
C = mat2cell(X, [1,10],[2,1]);
celldisp(C);
  1 件のコメント
william katzianer
william katzianer 2020 年 7 月 21 日
This does not work

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

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by