How to calculate the distances between the transformation matriecs?

1 回表示 (過去 30 日間)
M
M 2022 年 5 月 17 日
編集済み: Rangesh 2023 年 9 月 26 日
How to calculate the distances between the transformation matriecs as the following:
norm([D]) = inv[of each T] multiply by the 3rd column of the attached metrices[T] of the another T
I mean I have to multiply each inverse of the attached matrices by each 3rd column of all other matrices expect the 3rd column of the same inv(T) .
Then I want to calculate the minimum distances between each matrix and the another one.
Attched are the transormation matrices.
  2 件のコメント
Torsten
Torsten 2022 年 5 月 17 日
It depends on how you define the "distance" between matrices.
Just as
norm ( A(:) - B(:) )
if A and B are matrices of the same size ?
M
M 2022 年 5 月 17 日
編集済み: M 2022 年 5 月 17 日
@Torsten , I want to calculate it as the following:
norm([D]) = inv[of each T] multiply by the 3rd column of the attached metrices[T] of the another T
I mean I have to multiply each inverse of the attached matrices by each 3rd column of all other matrices expect the 3rd column of the same inv(T) .
Then taking the norm of the output vector

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

回答 (1 件)

Rangesh
Rangesh 2023 年 9 月 26 日
編集済み: Rangesh 2023 年 9 月 26 日
Hello,
I understand that you want to calculate the norm of kth transformation matrix. The steps are as follows:
Col3rd= T(:,3,:) -T(:,3,k);% Array containing 3rd column of a transformation matrix except the kth.
Sum3rd=sum(Col3rd,3);% Calculating the sum along the z axis.
x=inv(T(:,:,k))*Sum3rd; % output vector
normK=norm(x); %norm of output vector
  • In the first two lines, we extract the third column from all transformation matrices except the kth transformation matrix. Then, we sum the extracted columns along the z-axis.
  • The next line calculates the inverse of the kth transformation matrix and multiplies it with the sum obtained in the previous step.
  • In the last line, we use the "norm" function to calculate the norm of the resultant vector.
Later, the minimum distance can be calculated by the obtained the norm of each transformation matrix.
You can refer to the following MATLAB Documentations on “array-indexing” and “sum” for more information:
I hope this resolves your query.
Thanks,
Rangesh.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by