cell to matrix conversion

I have following cell matrix X(1x4):
[] [] [1,2,3;1,3,4] [1,2,3,4;1,3,4,2]
how do i split them into four seperate matrices?

 採用された回答

Wayne King
Wayne King 2013 年 5 月 29 日

0 投票

Then as Azzi says, just extract them in a for loop
X = {[] [] [1,2,3;1,3,4] [1,2,3,4;1,3,4,2]};
for ii = 1:4
size(X{ii}) % do whatever you want here
end

その他の回答 (1 件)

Wayne King
Wayne King 2013 年 5 月 29 日
編集済み: Wayne King 2013 年 5 月 29 日

0 投票

X = {[] [] [1,2,3;1,3,4] [1,2,3,4;1,3,4,2]};
[A,B,C,D] = deal(X{:});
Note that A and B are empty as expected.

4 件のコメント

John
John 2013 年 5 月 29 日
is there a way of not including [A,B,C,D], I would like to use these matrices in a for loop?
John
John 2013 年 5 月 29 日
that is to say : for each matrice I'll be performing certain function
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 5 月 29 日
Then just use
X{1}
X{2}
X{3}
X{4}
John
John 2013 年 5 月 29 日
thankyou!

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

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

質問済み:

2013 年 5 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by