Make a list of matrices in MatLab
March 1, 2007 11:15 AM Subscribe
How do I implement a Matrix (or list) of matrices in MatLab?
I need to make a list of matrices, the matrices are not all the same size. This seems like it should be really easy, but I can't figure out how to do it.
I need to make a list of matrices, the matrices are not all the same size. This seems like it should be really easy, but I can't figure out how to do it.
Best answer: Have you considered using a Cell Array?
posted by swordfishtrombones at 11:31 AM on March 1, 2007
posted by swordfishtrombones at 11:31 AM on March 1, 2007
I hope I am not doing someone's homework, but here's what I think you want (and I'll shut up now...
>> a = ones(5,5);
>> b = ones(6,6);
>> c{1} = a;
>> c{2} = b;
>> c
c =
[5x5 double] [6x6 double]
>> c{1}
ans =
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
posted by swordfishtrombones at 11:36 AM on March 1, 2007
>> a = ones(5,5);
>> b = ones(6,6);
>> c{1} = a;
>> c{2} = b;
>> c
c =
[5x5 double] [6x6 double]
>> c{1}
ans =
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
posted by swordfishtrombones at 11:36 AM on March 1, 2007
Response by poster: oh dear. Of course, a cell array.
swordfishtrombones, no, not homework. I'm moving a whole bunch of matrix manipulation code that was inadvisably written for MAPLE to MatLab, and I'm not really very familiar with the latter.
posted by atrazine at 12:15 PM on March 1, 2007
swordfishtrombones, no, not homework. I'm moving a whole bunch of matrix manipulation code that was inadvisably written for MAPLE to MatLab, and I'm not really very familiar with the latter.
posted by atrazine at 12:15 PM on March 1, 2007
« Older How do you make due in an area where you do not... | I'm not sure I actually know how to do Kegels. Newer »
This thread is closed to new comments.
posted by swordfishtrombones at 11:22 AM on March 1, 2007