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 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](/WebImages/31/write-a-matlab-program-to-calculate-yt-on-the-given-interval-1087594-1761572127-0.webp)