How to Loop variable names
2 次查看(过去 30 天)
显示 更早的评论
Does anybody know how to write a loop that does the same as this:
Y1 = zeros(5,8);
Y2 = zeros(5,8);
The loop below does not do the same thing.
X = {'1', '2'};
nX = length(X);
for iX = 1:nX;
Y{iX} = zeros(5,8);
end
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!