Question about using for loop and symsum together

3 Ansichten (letzte 30 Tage)
ho mark
ho mark am 9 Apr. 2017
Beantwortet: ho mark am 9 Apr. 2017
I am a beginner in using matlab and I have trouble in coding the above equation. I want to include a for loop in the calculation for Z = 0:0.05:2
My code is like this:
Z= 0:0.05:2
for i =0:length(Z)
syms m i
M=(pi/2)*(2*m+1)
U(Z) = 1-symsum((2/M)*sin(M*i)*exp(-M^2*0.5), m , 0 , Inf)
end
It seems symsum and for loop can't be used at the same time and the for loop increment can't be decimal, anyone knows the alternative way to code the equation? Thank you very much.

Antworten (1)

ho mark
ho mark am 9 Apr. 2017
push

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by