Below is my code that is attempting to populate a variable using section of rows. The original ContractFile is hundreds of thousands of rows - the thinking is I can populate the variable on different workers using the parfor loop which will populate sections of 10,000 rows at a time on a different worker. Example: Rows 1:10,000 to one worker, rows 10,001:20,000 to a different worker, etc. This code works as a regular for loop, but breaks as a parfor loop and I can't figure out why. Thanks!
parfor i = 1:Contracts
Rows = (i-1)*10000+(1:10000);
Var1(Rows,:) = ContractFile(Rows,2) .* ContractFile(Rows,8);
end
1 Comment
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/514690-using-groups-of-rows-in-a-parfor-loop#comment_819584
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/514690-using-groups-of-rows-in-a-parfor-loop#comment_819584
Sign in to comment.