How to detect rotation in a trajectory?

3 vues (au cours des 30 derniers jours)
Atanu
Atanu le 30 Avr 2022
Commenté : Star Strider le 2 Mai 2022
I have to write an algorithm to detect rotation in the trajectory. Basically, I have to detect the red zone in the trajectory. Currently I have the time and coordinate data.
How do I approach it?
  4 commentaires
Riccardo Scorretti
Riccardo Scorretti le 30 Avr 2022
You are working in a 2D or 3D space?
Atanu
Atanu le 1 Mai 2022
2-D space.

Connectez-vous pour commenter.

Réponse acceptée

Star Strider
Star Strider le 1 Mai 2022
I would use the gradient function to calculate the numerical derivative.
For example:
dydx = gradient(y) ./ gradient(x);
Plot that as a function of ‘x’ as well, and it may provide some clues on how to define that region of the curve.
.
  2 commentaires
Atanu
Atanu le 2 Mai 2022
Thanks for your input. I think this will work.
Star Strider
Star Strider le 2 Mai 2022
As always, my pleasure!

Connectez-vous pour commenter.

Plus de réponses (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 1 Mai 2022
One way of detecting the region of values is using logical indexing, e.g.:
t = ...
x = ...
y = ...
% Way 1
Ind = t>=0 & t<=5; % Select the region according to the time data
Xs = x(Ind);
Ys = y(Ind);
% Way 2
Ind = x>=0 & x<=5; % Select the region according to x data
Xs = x(Ind);
Ys = y(Ind);
  1 commentaire
Atanu
Atanu le 2 Mai 2022
Thanks for your comment.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Signal Processing dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by