problem with parfor loop

3 次查看(过去 30 天)
freebil
freebil 2013-10-2
评论: Matt J 2013-10-3
Is it possible to parfor this?
for iter=1:50
for i=1:100
x(:,i)= rand(3,1)
end
end

采纳的回答

Matt J
Matt J 2013-10-2
编辑:Matt J 2013-10-2
Sure, especially since the outer loop is not doing anything and can be abandoned.
parfor i=1:100
x(:,i)= rand(3,1)
end
  6 个评论
freebil
freebil 2013-10-3
x(iter,i)= rand(1) with parfor??
Matt J
Matt J 2013-10-3
编辑:Matt J 2013-10-3
You can do it, but doing it without loops
x=rand(50,100);
will be faster.

请先登录,再进行评论。

更多回答(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