Syms variable cannot be classified?
Afficher commentaires plus anciens
In the code below, the variable Qv cannot be classified, and I have no idea why. From the documentation at https://www.mathworks.com/help/distcomp/troubleshoot-variables-in-parfor-loops.html it looks like I am following all of the rules. My code looks like the one on the top right example and I reset my variable using "syms Qv". The only fix I noticed was making the variable not symbolic, but that is a requirement for the variables since I am building a matrix of linear equations that I intend to solve.
I can attach files with the variables needed to run this but basically dd is just a cell array of diameters, ll is a cell array of lengths, CC is a cell connectivity matrix, and pns is a symbolic array with some unknown values and some known values.
Anyone know what is wrong here? Thanks in advance.
parfor i=1:size(CC,1)
h = 0;
syms Qj
for j=1:size(CC)
syms Qv;
if ~isempty(CC(i,j))
k = 0;
h = h+1;
k(h) = j;
for vess = 1:size(CC{i,j})
Qv(vess,:) = -((dd{i,j}(vess,:)^3)/(12*mu))*((pns(i)-pns(j))/ll{i,j}(vess,:));
end
Qj(j,:) = Qv;
else
Qj(j,:) = 0;
end
end
QQ(i,:) = num2cell(Qj);
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Operations on Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!