usage of syms in for loop?
2 views (last 30 days)
Show older comments
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
0 Comments
Answers (1)
Walter Roberson
on 25 Jan 2016
Edited: Walter Roberson
on 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 Comments
Walter Roberson
on 25 Jan 2016
Before the loop, use
bx = sym(zeros(15,1));
dx = sym(zeros(15,1));
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!