Run multiple parfor loops

2 次查看(过去 30 天)
Is it possible to run multiple parfor loops successively like in the following example:
A = zeros(4, 10);
parfor i = 1:4
for j = 1:10
if j < 6
A(i, j) = i + j;
else
A(i, j) = pi;
end
end
end
B = zeros(4, 10);
parfor i = 1:4
for j = 1:10
if j < 4
B(i, j) = i ;
else
B(i, j) = 2*pi;
end
end
end
  1 个评论
KSSV
KSSV 2017-2-24
You should have run this and checked. It run's well. you can run two par fors successively.

请先登录,再进行评论。

采纳的回答

Jan
Jan 2017-2-24
Yes.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by