How to solve the loss of values while using the diff function ?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hey guys , So i was given the altitude and time data for a certain incident and i was required to find velocity and acceleration . This is what a part of my code looks like :
t=0:10:250;
tv=(t(1)+t(2))/2:10:t(end);
vel=diff(c)./diff(t);
acc=diff(vel)./diff(tv);
But what do i define my time for acceleration as? is it ta = (tv(1)+tv(2))/2:10:t(end); because that did not seems to work as it would have 25 elements while i only need 24 as the acceleration variable has only 24 elements . Please help ! thanks in advance!
0 comentarios
Respuestas (2)
Stephen23
el 18 de Mayo de 2017
Editada: Stephen23
el 18 de Mayo de 2017
1 comentario
Sean de Wolski
el 18 de Mayo de 2017
Slick. I've always zero-padded or used one of the FEX entries but this is better.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!