extract matrix from for loop
显示 更早的评论
Hi,
I want to extract a 2x2 matrix from each iteration of a for loop. Normally I would use something like
for loop=1:1:10
m=[a b c d];
m2(loop)=m;
end
but this doesn't work because of the increased dimensions. Can anyone help?
采纳的回答
更多回答(1 个)
Sean de Wolski
2011-5-16
m2 = repmat(m,[1 10]);
or
m2 = repmat(m,[10 1]);
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!