using symsum for elements of array
1 view (last 30 days)
Show older comments
Ardalan Norouzi
on 28 Nov 2015
Answered: Star Strider
on 28 Nov 2015
Hello everyone I wrote this code:
syms q
llayers=5;
effstress=zeros(1,llayers);
thick=[20 30 10 20 50]
rho=[120 130 120 150 140]
for i=2:llayers
effstress(1,i)=symsum(thick(q).*rho(q),1,i-1)
end
Would you please help me in this issue? Thanks a lot
0 Comments
Accepted Answer
Star Strider
on 28 Nov 2015
I am not certain I understand what you want.
See if this works:
thick=[20 30 10 20 50];
rho=[120 130 120 150 140];
effstress = cumsum(thick .* rho);
effstress =
2400 6300 7500 10500 17500
0 Comments
More Answers (0)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!