フィルターのクリア

deriving a position matrix

2 ビュー (過去 30 日間)
Tim De Witte
Tim De Witte 2024 年 4 月 2 日
コメント済み: Voss 2024 年 4 月 8 日
I have a position matrix of my joints like this
Joint1 [p1 p2 p3 p4 p5 p6]
Joint2 [p1 p2 p3 p4 p5 p6]
Joint3 [p1 p2 p3 p4 p5 p6]
I want to get the velocity matrix by deriving this matrix, how is this possible?

回答 (1 件)

Ishu
Ishu 2024 年 4 月 4 日
Hi Tim,
In order to derive the velocity matrix from the position matrix you need to differentiate position matrix with respect to time.
I am assuming that the sample rate is constant, hence the velocity can be approximated by the difference between the successive position joints divided by the time interval between those joints. To calculate the difference you can use "diff" function of MATLAB.
% Replace your positionMatrxi with your actual values
positionMatrix = [
1, 2, 3, 4, 5, 6; % Joint1
2, 3, 4, 5, 6, 7; % Joint2
3, 4, 5, 6, 7, 8 % Joint3
];
deltaT = time_difference; % Time interval between samples
velocityMatrix = diff(positionMatrix, 1, 2) / deltaT;
You can refer this documentation for "diff" function:
Hope it helps!
  2 件のコメント
Tim De Witte
Tim De Witte 2024 年 4 月 8 日
Yes I did that but I would need a matrix of the same size :/
Voss
Voss 2024 年 4 月 8 日

Look into using gradient instead of diff.

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

カテゴリ

Help Center および File ExchangeAssembly についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by