what should i do to to evaluate the total length of a trajectory obtained as the sum of the distances of a point from the next??

Hello everyone, I'm working on my specialist degree thesis (Biomedical Engeenering) and I have to evaluate many parametres about length,velocity,acceleration,mean frequency and others. Expecially I need an Help for evaluating these parametres with Matlab ( I never used the programming language Matlab and I'm very worried about my work thesis ):
  1. Item one: *the total length of a trajectory obtained as the sum of the distances of a point frome the next:*L=∑_(i=1)^(n-1)▒√(〖(AP[i+1]-AP[i])〗^2+〖(ML[i+1]-ML[i])〗^2 ) where AP (antero-posterior) and Ml(medio-lateral) represent 2 different directions where the points are localized.
  2. Item two _ * The length AP is the sum of the absolute distances between two consecutive points towards AP direction*_Lap= ∑_(i=1)^(n-1)▒|AP[i+1]-AP[i]|
How this can be done on Matlab???? thanks in advance

 Réponse acceptée

If AP and ML are vectors, you can use
L = sum(sqrt(diff(AP).^2 + diff(ML).^2));
Lap = sum(abs(diff(AP)))

4 commentaires

AP(ì) is the point in a curve at position (i) in the Antero-posterior direction , AP(ì+1) is its following point. The same applies to medio-lateral direction (ML). any point has two coordinate like (x,y).
That's fine. Does it work for you as expected? Then please formally accept my answer.
You overlooked that AP and ML are points with two coordinates x and y ...
Best wishes
Torsten.
Could I use a For loop instead of sum.?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by