calculate y(t) for the following equation:y(t) = -2*t^3+5 (t>=0) and y(t) = 2*t^3+5 (t<0).The values of y should be calculated in the range -9 <= t <= 9. Calculatea value of y for every t in increments of 0.1 in the range specified. Thevalues of y should be collected in a single array. Generate a plot of y vs. t using the plot command. The curve should be in solid green line with widthof 2. Make sure you have proper axis labels.
This is what I've come up too:
t = [ -9 : 0.1 : 9 ];for ii = t >= 0 y = -2*t.^(3)+5;endfor jj = t<0 y = 2*t.^(3)+5;endplot(y , 'g', 'linewidth',2)
I'm wondering shouldn't my x axis be the t values, I think I've got something missing here.
Best Answer