Is there any way to create array of arrays or matrix of matrices?

209 Ansichten (letzte 30 Tage)
i want to create array of arrays or matrix of matrices?
or
create arrays automatically in{ for - loop} then combine them in one array .

Akzeptierte Antwort

Jan
Jan am 16 Mai 2013
Arrays can contain all types of Matlab variables as elements, but no arrays.
A "matrix of matrices" can be seen as 4D array:
a = zeros(2, 2, 3, 4);
a(:, :, 1, 1) = rand(2, 2);
etc.
Or with a loop:
for i1 = 1:3
for i2 = 1:4
a(:, :, i1, i2) = rand(2, 2);
end
end
  6 Kommentare
Jan
Jan am 17 Mai 2013
@aboomnea: Is the original problem solved?
Isee You
Isee You am 17 Mai 2013
thanks very much @jan-simon:
it solve my problem

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by