how to show a velocity vector at any two point in matlabs on path curve.also acceleration vector at any two point on velocity curve.

조회 수: 1 (최근 30일)
we have path curve "x = t*exp(-3*t)+0.25*exp(-3*t);" time=t=( 0:0.01:3).. velocity=exp(-3*t)/4 - 3*t*exp(-3*t) accleration =9*t*exp(-3*t) - (15*exp(-3*t))/4
  댓글 수: 2
Manolis Michailidis
Manolis Michailidis 2015년 10월 12일
If i understand correctly you want to plot all together in one graph? when you say show volecity vector...
Rahman Ali
Rahman Ali 2015년 10월 12일
편집: Rahman Ali 2015년 10월 12일
no simply for velocity.. leave acceleration..

댓글을 달려면 로그인하십시오.

답변 (1개)

Manolis Michailidis
Manolis Michailidis 2015년 10월 12일
편집: Manolis Michailidis 2015년 10월 12일
If this is the case ou can use plot and hold on to achieve it.
t=( 0:0.01:3);
x = t.*exp(-3*t)+0.25*exp(-3*t);
v=exp(-3*t)/4 - 3.*t*exp(-3*t);
a =9*t.*exp(-3*t) - (15*exp(-3*t))/4;
plot(t,x);hold on;plot(t,v,'r');hold on;plot(t,a,'g');
legend('x-curve','volecity','acceleration');
hold on
I hope this helps.
  댓글 수: 2
Rahman Ali
Rahman Ali 2015년 10월 12일
path curve like that now i want
</matlabcentral/answers/uploaded_files/38341/6.PNG> now i want to show a velaocity vector at any two point on this curve mean to draw any two tangent to that curve..
Manolis Michailidis
Manolis Michailidis 2015년 10월 12일
편집: Manolis Michailidis 2015년 10월 12일
I can't see your uploaded image, can you upload it somewhere else and post the link? or try to reupload it here. You can try to ask from the user to enter the points , of course the points should be in the right limits of t , and then you can plot the volecity v for only this 2 points, something like that maybe:
t1 = 'What is the first value? ';
x1 = input(t1);
t2 = 'What is the other value? ';
x2 = input(t2);
% create time vector with 100 points between the values user has set
T=linspace(x1,x2,100);
x = T.*exp(-3*T)+0.25*exp(-3*T);
v=exp(-3*T)/4 - 3*T.*exp(-3*T);
plot(T,x);hold on;plot(T,v,'r');
legend('x-curve','volecity');
grid on

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by