Effacer les filtres
Effacer les filtres

Climbing Power Equation: how to make a calculation into usable code

2 vues (au cours des 30 derniers jours)
Robert J Hanna
Robert J Hanna le 24 Nov 2020
Commenté : Robert J Hanna le 27 Nov 2020
I'm trying to write a specific equation that includes derivation. This specifically:
The data I am looking at is from three cameras focused on a flying bird. after running the position data through some smoothing functions its derived to get velocity and acceleration.
So I'm working with the velocities in the X,Y, and Z directions in an excel file (aDdatafilt1).
Heres what I have so far but I don't think Im using diff() correctly:
%GENERATE CLIMB POWER FOR BIRD "A"
XVel=aDdatafilt1(:,1);
YVel=aDdatafilt1(:,2);
ZPos=aDdata(:,3); % aDdata = position data
t=[1/60] ; %fps of cams = 60
XYVel=sqrt(XVel.^2+YVel.^2);
Pkmt=(.5.*abs(XYVel).^2+(9.8)*(ZPos));
Pkm = diff(Pkmt,t)
Thanks.

Réponse acceptée

Rohit Pappu
Rohit Pappu le 27 Nov 2020
To calculate the first derivative of a particular vector X, the syntax is diff(X,1)
For the above equation,
Pkm = diff(Pkmt,1)/t
is equivalent to

Plus de réponses (0)

Catégories

En savoir plus sur Automotive dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by