Info

This question is closed. Reopen it to edit or answer.

Error "Subscripted assignment dimension mismatch" using parfor

1 view (last 30 days)
Hi
I want to use parfor to derive large symbolic matrices as presented below:
Stiffness = sym('K',[PP PP]); Inertia = sym('M',[PP PP]);
parfor m=1:PP
KK = simplify(diff(Strain_Energy/g^2,P(m)));
MM = simplify(diff(Kinetic_Energy/(omega^2*g^2),P(m)));
stiffness = sym('K',[1 PP]);
inertia = sym('M',[1 PP]);
for n=1:PP
[KKq,KKr] = quorem(KK,P(n),P(n));
stiffness(m,n) = KKq;
[MMq,MMr] = quorem(MM,P(n),P(n));
inertia(m,n) = MMq;
end
Stiffness(m,:) = stiffness;
Inertia(m,:) = inertia;
end
I receive the error:
"""""""""""""""""""""""""""""""""""""""""""
Error using sym/privsubsasgn (line 1067)
Subscripted assignment dimension mismatch.
Error in sym/subsasgn (line 904)
C = privsubsasgn(L,R,inds{:});
Error in HSDT_Linear (line 116)
parfor m=1:PP
""""""""""""""""""""""""""""""""""""""""""""
I tried to tailor the content of the parfor loop according to the requirements described by the documentation but still this error exists.
Can someone help please?
  8 Comments

Answers (0)

Products


Release

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!