MATLAB: Plot window is coming up blank. Why

blank plot window.

t = 0:0.01:10
for vs = 3.*exp(-t /3).*sin(pi*t)
if (vs <= 0)
vl = 0;
else
vl = vs;
end
end
plot(t,vl)
title('Load voltage vs Time')

Best Answer

t = 0:0.01:10;
vs = 3.*exp(-t /3).*sin(pi*t);
vl=vs;
vl(vs<=0)=0;
plot(t,vl)