MATLAB: How do i dfferentiate u with respect to t

differentiation

mi=2290000;
mf=130000;
tb=165;
t=linspace(0,165);
mr=mi-((mi-mf)*(t/tb));
hold all
g = 9.81;
Isp=263;
u=g.*(Isp.*log(mi./mr)-t);
f1=figure;
plot (t,u, 'red')
p = cumtrapz(t,u);
f2=figure;
plot(t,p, 'blue')

Best Answer

gradient(u, t(2)-t(1))