I solved this question, but unabled to get the markers. Whenever I add markers M
ID: 643596 • Letter: I
Question
I solved this question, but unabled to get the markers. Whenever I add markers MATLAB makes the graph bold.
Here is my code
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot velocity,acceleration, and position
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% x(t)= -0.1t^4+0.8t^3+10t-70
% v(t)= -0.4t^3+2.4t^2+10 (derivative of x(t) with respect to t)
% a(t)= -1.2t^2+4.8t (derivative of v(t) with respect to t)
% assigning t
t=0:0.01:8;
% calculating x,v,and a
x=(-0.1.*(t.^4)+(0.8.*(t.^3))+(10.*t)-(70));
v=(-0.4.*(t.^3)+(2.4.*(t.^2))+(10));
a=(-1.2.*(t.^2)+(4.8.*t));
%plotting
subplot(3,1,1)
plot(t,x,'r','LineWidth',2)
xlabel('Time (s)')
ylabel('Position (m)')
subplot(3,1,2)
plot(t,v,'LineWidth',1)
xlabel('Time (s)')
ylabel('Velocity (m/s)')
subplot(3,1,3)
plot(t,a,'black:','LineWidth',2)
xlabel('Time (s)')
ylabel('Accleration (m/s^2)')
Please check where am I wrong, and give me the right answer.
Problem 2: The position x (in meters) as a function of time of a particle that moves along a straight line is given by: x(t)=-0.1t^4+0.8t^3+10t-70 The velocity of the particle v(t) is determined by the derivative of x(t) with respect to t, and the acceleration is determined by the derivative of v(t) with respect to t. Derive the expressions (by hand) for the velocity and the acceleration of the particle, and make plots for the position (red line, no marker, width of 2), velocity (blue line, plus marker, width of 1) and acceleration (black line, dotted, no marker, width of 2) for 0Explanation / Answer
See just increase the sampling time from 0.01 to 0.1 in the line t=0:0.01:8;
the markers are coming too close and hence the graph is geting bold..
here is the code. i have made the change
% x(t)= -0.1t^4+0.8t^3+10t-70
% v(t)= -0.4t^3+2.4t^2+10 (derivative of x(t) with respect to t)
% a(t)= -1.2t^2+4.8t (derivative of v(t) with respect to t)
% assigning t
t=0:0.1:8;
% calculating x,v,and a
x=(-0.1.*(t.^4)+(0.8.*(t.^3))+(10.*t)-(70));
v=(-0.4.*(t.^3)+(2.4.*(t.^2))+(10));
a=(-1.2.*(t.^2)+(4.8.*t));
%plotting
subplot(3,1,1)
plot(t,x,'r','LineWidth',2)
xlabel('Time (s)')
ylabel('Position (m)')
subplot(3,1,2)
plot(t,v,'b*','LineWidth',1);
xlabel('Time (s)')
ylabel('Velocity (m/s)')
subplot(3,1,3)
plot(t,a,'black:','LineWidth',2)
xlabel('Time (s)')
ylabel('Accleration (m/s^2)')