usage of syms in for loop?
Afficher commentaires plus anciens
for i=1:15
bx=zeros(15,1)
dx=zeros(15,1)
syms b d
VNX(i) = ((Av(i)*Fy(i)*0.8*d)/S(i))+(0.16*sqrt(Fck(i))*b*d)+((0.48*P(i))/sqrt(Fck(i)))
assume(b>0)
assume(d>0)
sol = solve([VNX], [b,d]);
bx(i) = sol.b
dx(i) = sol.d
end
Réponses (1)
Walter Roberson
le 25 Jan 2016
Modifié(e) : Walter Roberson
le 25 Jan 2016
You did not ask a question. But meanwhile you need to fix the problems I described for your other question http://uk.mathworks.com/matlabcentral/answers/265042-how-to-optimize-this-solution#answer_207291
By the way, you do not want
bx=zeros(15,1)
dx=zeros(15,1)
inside your "for" loop, as that is going to reinitialize all of bx and dx each iteration of "i", overwriting all the answers you got before.
2 commentaires
abdul haakim mohammed
le 25 Jan 2016
Walter Roberson
le 25 Jan 2016
Before the loop, use
bx = sym(zeros(15,1));
dx = sym(zeros(15,1));
Catégories
En savoir plus sur Common Operations 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!