0

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.

Uruguayo
  • 21
  • 4

1 Answers1

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,035
  • 17
  • 57
  • 82
Ander Biguri
  • 33,979
  • 10
  • 76
  • 115