Generating a series of marices

1 view (last 30 days)
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 Comment
Star Strider
Star Strider on 3 Feb 2015
Don’t do that!
Simply address your row vectors as elements in your ‘a’ matrix. Don’t create individual variables for each row.

Sign in to comment.

Accepted Answer

Michael Haderlein
Michael Haderlein on 3 Feb 2015
m=cell(size(a,1),1);
for k=1:size(a,1)
m{k}=a(k,:);
end

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!