'How to use Matlab symsum?

This is the question of a heat transform problem. Basically, I want to solve the value when (x,t) = (0.3,0.01)

This is the code I wrote:

answer=T(0.3,0.01);

disp(answer);

function y=T(x,t)

syms n

f=(sin(1/2*n*pi))*sin(n*pi*x)*(exp(-(n^2*pi^2*t)/n^2));

sig=symsum(f,n,1,inf);

y=8/pi^2*sig;

end

However, the result is NAN!

I found out that the problem was in "symsum".

Could you please try to help me fix this problem, thank you!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source