Generating a series of marices

1 回表示 (過去 30 日間)
Alex O'Neill
Alex O'Neill 2015 年 2 月 3 日
コメント済み: Star Strider 2015 年 2 月 3 日
Basically, I'm trying to read a large matrix and then break that into a series of arrays. I was attempting something of the nature.
for i= 1:size(a,1)
m_i = a(i, 1:size(a,2)
end
and I want to get back
m_1 = [....] m_2 = [.....] m_3 = [....]
any help on what actual command to use would very helpful. Thanks
  1 件のコメント
Star Strider
Star Strider 2015 年 2 月 3 日
Don’t do that!
Simply address your row vectors as elements in your ‘a’ matrix. Don’t create individual variables for each row.

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

採用された回答

Michael Haderlein
Michael Haderlein 2015 年 2 月 3 日
m=cell(size(a,1),1);
for k=1:size(a,1)
m{k}=a(k,:);
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by