problem with parfor loop

2 views (last 30 days)
freebil
freebil on 2 Oct 2013
Commented: Matt J on 3 Oct 2013
Is it possible to parfor this?
for iter=1:50
for i=1:100
x(:,i)= rand(3,1)
end
end

Accepted Answer

Matt J
Matt J on 2 Oct 2013
Edited: Matt J on 2 Oct 2013
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 Comments
Matt J
Matt J on 3 Oct 2013
You can do it, but doing it without loops
x=rand(50,100);
will be faster.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!