fill() in parfor loop
4 次查看(过去 30 天)
显示 更早的评论
I've got ~200,000 polygons to be plotted with fill().
for i=1:size(data,1);
x=data(i,3:2:9);
y=data(i,4:2:10);
f=fill(x,y,data(i,2));
hold on;
end
It works well but takes a bit of time. When I use 'matlabpool open local 4' and change 'for' to 'parfor', I've got no figure output. Any solutions please?
1 个评论
采纳的回答
Titus Edelhofer
2012-4-18
Hi,
you should be able to call fill with the corresponding matrices directly, something like
f = fill(data(:, 3:2:9)', data(:, 4:2:10)', data(:,2)');
Titus
2 个评论
Titus Edelhofer
2012-4-19
Hi Seb, your welcome. You might mark the question then as answered, if you think it is ...
更多回答(1 个)
Edric Ellis
2012-4-18
Unfortunately, you cannot use a PARFOR loop in this way. The workers cannot create graphics on your client.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parallel Computing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!