Why is my parfor loop not running?
34 ビュー (過去 30 日間)
Marc Laub 2020 年 6 月 10 日
コメント済み: Edric Ellis 2020 年 6 月 11 日
I guess this question has been asked multiple times. I did all the troubleshooting before but I still dont undersatdn why my following parfor loop wont run.
ptRads = seeder(pts);
I preallocated my array seeds and I dont know why Matlab would be unable to classify my variable seeds. It should just calculate the functions partial_seeder and seeder in parallel and write the results into seeds... not sure why it wont work.
Many Thanks in advance
Edric Ellis 2020 年 6 月 11 日
As it happens, I already provided the answer to this question before I'd even seen the question - see here https://www.mathworks.com/matlabcentral/answers/545921-how-to-use-fetchnext-correctly . Basically, this is a parfor slicing constraint - you're not allowed two different assignment expressions into seeds - you have to make a temporary variable for each iteration of the parfor loop so that you can make only a single assignment.
回答 (0 件)
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!