How to define an array with multiple columns for each parameter in a for loop?
3 次查看(过去 30 天)
显示 更早的评论
I have a loop where each parameter should create an array with 20 columns so for n=1, there's 20 columns in the array, n=2, there's 20 columns in the array etc; so the final array should have 20*sz columns but am not sure how to code this (attempt below):
for n=1:sz
array(:,20]);
end
0 个评论
采纳的回答
James Tursa
2017-1-9
At each iteration, the array sub-section indexing would be:
array(:,n*20-19:n*20)
0 个评论
更多回答(0 个)
另请参阅
类别
在 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!