MATLAB: How to express this function

matlab function

How do I express this function in MATLAB?
when T = 3s, W = Pi rad/s, t has a value, from 0 to 10 seconds.
y(t) = 10 * e^(-t / T) * sin(W * t)
(T is time constant. and W is angular velocity.)

Best Answer

function y=test1()
T=3;
W=pi;
t=0.01:10
y=10*exp((-t./T).*sin(W.*t))
end
Or Direct
T=3;
W=pi;
t=0.01:10;
y=10*exp((-t./T).*sin(W.*t))