Is there any way to create array of arrays or matrix of matrices?
204 次查看(过去 30 天)
显示 更早的评论
i want to create array of arrays or matrix of matrices?
or
create arrays automatically in{ for - loop} then combine them in one array .
0 个评论
采纳的回答
Jan
2013-5-16
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!