Use cell arrays. Like this
c = cell(3,3) %Create cell array of size *3x3*
c =
[] [] []
[] [] []
[] [] []
c{1,1}; = rand(3,3); %Set cell {1,1} to be random matrix of size *3x3*
c{1,2} = ones(4,6) %Set cell {1,2} to be matrix of ones size *4x6*
c =
[3x3 double] [4x6 double] []
[] [] []
[] [] []
etc..
source
share