The following code calculates the matrix elements of A from the vector v. I try to use parfor to speedup the calculation as the dimension of v is very large. I get an error of "The variable A in a parfor cannot be classified.". Any suggestions on how to solve the problem?
A = zeros(n,n);
for kk = 1:D
% sk = <expressions...>
% ek = <expressions...>
parfor ll = 1:D
% sl = <expressions...>
% el = <expressions...>
if (ek == el)
A(sk,sl) = A(sk,sl) + v(kk) * v(ll);
end
end
end
