How to detect rotation in a trajectory?

2 ビュー (過去 30 日間)
Struggling in MATLAB
Struggling in MATLAB 2022 年 4 月 30 日
コメント済み: Star Strider 2022 年 5 月 2 日
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 件のコメント
Riccardo Scorretti
Riccardo Scorretti 2022 年 4 月 30 日
You are working in a 2D or 3D space?
Struggling in MATLAB
Struggling in MATLAB 2022 年 5 月 1 日
2-D space.

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2022 年 5 月 1 日
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 件のコメント
Struggling in MATLAB
Struggling in MATLAB 2022 年 5 月 2 日
Thanks for your input. I think this will work.
Star Strider
Star Strider 2022 年 5 月 2 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022 年 5 月 1 日
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 件のコメント
Struggling in MATLAB
Struggling in MATLAB 2022 年 5 月 2 日
Thanks for your comment.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDigital Filter Analysis についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by