How to improve speed when printing multiple images inside a for loop
8 次查看(过去 30 天)
显示 更早的评论
My code generates a figure on each iteration of a for loop, which is printed to a png file each time. Is there a way to speed up this process by letting Matlab continue with the loop while the printing is ongoing? (like a fork-join kind of flow). Any help will be welcome. Example code:
for k=1:10
aux = randn(1e3);
fh = figure('visible','off'); imagesc(aux);
print(fh,'-dpng','-r0','./temp.png'); close(fh)
end
2 个评论
采纳的回答
更多回答(1 个)
Rik
2018-2-2
It is also possible print is inherently slower than it could be, in which case the screencapture FEX submission by Yair Altman might result in a speed increase. You can even use that parfeval in combination with this.
0 个评论
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!