MATLAB: I want to Plot the solution of velocity

MATLAB

I need to Plot the solution with a constant 1000 N force.
F_rocket = 1000 N , m = 5 kg , c = 2 , v(0) = 0 m/s , v(t) = F_rocket/c * (1 – e^ ( -c*t/m ) )
what i write in my script is:
f_rocket=100
c=1
m=2
r=(-c/m)
t=0:10
v_(t)=(f_rocket/c)*(1-exp(r*t))
plot(v_(t),t)

Best Answer

clc; clear all ;
f_rocket=100 ;
c=1 ;
m=2 ;
r=(-c/m) ;
t=0:100 ;
v=(f_rocket/c)*(1-exp(r*t)) ;
figure
plot(v,t)
figure
axis([0 t(end) min(v) max(v)]) ;
hold on
for i = 1:length(t)
plot(v(i),t(i),'.r') ;
pause(0.1)
end