for loops.
1 次查看(过去 30 天)
显示 更早的评论
Hello! Please, how can I implement an iteration, such that a first loop executes a series of expressions within a range of (32) values and a second loop executes a series of expressions within another range of(16) values for each result of the first iteration. the result of this would be 512 iterations. Thank u.
1 个评论
Walter Roberson
2011-3-31
Are the values independent or does the first loop need to complete before the second loop could start?
采纳的回答
the cyclist
2011-3-31
I guess you mean nested loops?
for ni=1:32
for nj=1:16
% Do something here?
end
end
4 个评论
Walter Roberson
2011-3-31
parfor ni=1:32
%do first thing here
end
parfor ni=1:32
for nj=1:16
%do second thing here
end
end
It would, though, not surprise me if the first parfor would be more efficient as a for loop -- depends how much work is done in the first part.
更多回答(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!