Unable to classify the variable in the body of the parfor-loop.
Show older comments
I am trying to set up a parfor nested loop in MatLab R2020a as below
function [stiffness, mass] = assemble(stiffness, mass, k, m, index)
edof = length(index);
parfor i = 1:edof
ii = index(i);
for j = 1:edof
jj = index(j);
stiffness(ii, jj) = stiffness(ii, jj) + k(i, j);
mass(ii, jj) = mass(ii, jj) + m(i, j);
end
end
The code analyzer returns this message: "Valid indices for 'stiffness' are restricted in parfor loops".
and the command window said: "Unable to classify the variable 'stiffness' in the body of the parfor-loop".
I am really appreciate if somone could explain the problem to me. Thank you very much!
Accepted Answer
More Answers (0)
Categories
Find more on Parallel for-Loops (parfor) 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!