I have a 1024*19 matrix and i want to create 19 matrices from each column

I have a 1024*19 matrix and i want to create 19 matrices from each column and save them seperately
I 'll try with this.
_*for i=1:19
C(i)=B(:,i)
save C(i)
end_*
but it isn't right. Does anyone has any idea?

 Accepted Answer

Use mat2cell()

5 Comments

i ll' try this
for i=1:19
D{i}=B(:,i)
save D{i}
end
Thanks!
That is going to try to save into a constant file named literally 'D{i}' (the same filename each time.)
When you save the individual matrices, what variable name do you want them to show up as in the individual files?
i am thinking about giving a name like D1 for the first column of Bmatrix, D2 for the second etc.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!