%-------------------------------------% % Homework 5: 4.1 % % Date: 10/21/2002 % % % % Gun Srijuntongsiri % % gs61 % % ?????? % %-------------------------------------% % Variables: % t = free variable running from -9 to 9 % y = y(t) from the equation format compact % Suppress extra space b/w lines disp(' t y'); % header of tables % Calculate for t between -9 and 9 in steps of .5 for t = -9:.5:9 % Depend on t, calculate y(t) accordingly if t>=0 y = -3*t^2+5; else y=3*t^2 + 5; end disp([t,y]); end