I have several matrices, with the same number of rows but different column size. I want to store them in one element (whatever that is), so I can access each matrix in a loop at different iterations.
Asked
Active
Viewed 44 times
1 Answers
2
The only basic MATLAB class that can store different types in each of the elements is a cell array
.
A{1}='hello';
A{2}=rand(4,5);
A{3}=rand(4,25);
A cell array is accessed with curly brackets {}
.
Read more in the official documentation

Graham
- 7,431
- 18
- 59
- 84

Ander Biguri
- 35,140
- 11
- 74
- 120
-
Was about to upvote your comment. But you deleted... so no one could copy ;) – Tony Tannous Feb 15 '17 at 17:45
-
@TonyTannous Noo, I delete it when I decide to answer. No advantage of having a comment and an answer saying the same – Ander Biguri Feb 15 '17 at 17:46
-
1I was obviously joking... no offense. – Tony Tannous Feb 15 '17 at 17:47
-
1@TonyTannous ;) none taken! – Ander Biguri Feb 15 '17 at 17:47