for t=0:1:25if t<5 v=(0.1553567*t^6)-(2.0416*t^5)+(9.1837*t^4)-(14.829*t^3)-(1.3704*t)+(32.821*t)-1.3155; plot(t,v,'b+-') hold onendif t>=5&&t<15.4 v=(0.003980879*t^5)-(0.2247*t^4)+(4.8682*t^3)-(50.442*t^2)+(254.67*t)-430.66; plot(t,v,'b+-') hold onendif t>=15.4 v=-(0.073*t^2)+(6.1802*t)+40.423; plot(t,v,'b+-') hold onendtitle('Camero Accelerating')xlabel('Time(s)')ylabel('Speed(mph)')xlim([0 30])ylim([0 160])end
MATLAB: How do i get the graph to produce a straight line other than just points? Thanks.
graph plotting
Best Answer