Write a MATLAB program to calculate yt on the given interval

Write a MATLAB program to calculate y(t) on the given intervals of t: y(t) = {-3t^2 + 5 0

Solution

a)

t=-2;

i=0;

T[0]=t;

while t < 3

                if t < 0

                               y[i]=3*t^2+5;

                else

                               y[i]=-3*t^2+5

                end

                t=t+0.1;

                i=i+1;

                T[i]=t;

end

figure

plot(T,y);

ylabel(‘y(t)’);

xlabel(‘Time-seconds’);

 Write a MATLAB program to calculate y(t) on the given intervals of t: y(t) = {-3t^2 + 5 0 Solutiona) t=-2; i=0; T[0]=t; while t < 3 if t < 0 y[i]=3*t^2+5

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site