MATLAB: Help,, someone please, how to plot with this equation? what error in the coding, check please!!!

sofia

if true
% code
endclear
clc
syms z n
b=2*sin(2*pi*z)*sin(n*pi*z);
A=2*int(b,z,0,1)
y=0:1:10;
t=0:1:10;
[Y,T]=meshgrid(y,t);
for n=1
B=exp(-1/10)*(n^2)*(pi^2).*T*sin*n*pi.Y));
u=A.*B;
plot(Y,u)
end

Best Answer

clear
clc
%n=2
syms z n
b=2*sin(2*pi*z)*sin(n*pi*z);
As=2*int(b,z,0,1) ;
y=0:1:10;
t=0:1:10;
[Y,T]=meshgrid(y,t);
u = zeros(size(Y)) ;
for n=1:1000
n
A = double(subs(As,n)) ;
B=exp(-(1/10)*(n^2)*(pi^2).*T*sin(n*pi.*Y));
%u=sum((A.*B), n=1..100);
u=u+A.*B ;
end
surf(Y,T,u)