i have sym to double error in my loop.
Afficher commentaires plus anciens
for i=1:njoint
q(:,:)=0
for j=1:2
for k=1:nelement
if elnode(k,j) == i
q(i,1) = q(i,1) - cc(k,j,1)
q(i,2) = q(i,2) - cc(k,j,2)
q(i,3) = q(i,3) - cc(k,j,3)
else
continue
end
end
end
q(i,1) = q(i,1) + ss(i,1) + jload(i,1)
q(i,2) = q(i,2) + ss(i,2)+ jload(i,2)
q(i,3) = q(i,3) + ss(i,3) + jload(i,3)
end
its my loop and ss matrix is a matrix with variable arrays. i want to create q matrix with ss matrix. i faced this error: The following error occurred converting from sym to double: DOUBLE cannot convert the input expression into a double array.
Error in analyze (line 96) q(i,1) = q(i,1) - cc(k,j,1)
2 commentaires
Walter Roberson
le 4 Juin 2018
What is class(q) before the loop?
What is class(cc) ?
What is the output of
symvar(cc)
KSSV
le 4 Juin 2018
You are showing only a part of code.....what is q ? What is it's class?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Symbolic Variables, Expressions, Functions, and Settings 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!