Differentiation of altitude and finding time when max v

2 visualizaciones (últimos 30 días)
I have a set of data from a spreadsheet with the altitude of rocket at time t the initial altitude is 60m. When i diff(a)/diff(t) for velocity i only get 25 values and i found the maximum velocity now how do i find the time at which it occurs

Respuesta aceptada

Star Strider
Star Strider el 26 de Mayo de 2017
Use the gradient function instead of diff to calculate the derivatives. It is the same length as the original vector, so the maximum velocity will correspond to the correct time.
Example
t = linspace(0, 10); % Create Data
a = cos(2*pi*t/max(t)); % Create Data
dt = mean(diff(t));
velocity = gradient(a, dt);
t_max = t(velocity == max(velocity));
figure(1)
plot(t,a, t,velocity)
hold on
plot(t_max,max(velocity),'pg', 'MarkerSize',10, 'MarkerFaceColor','g')
hold off
grid

Más respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by