How to calculate the distances between the transformation matriecs?
1 view (last 30 days)
Show older comments
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 Comments
Torsten
on 17 May 2022
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 ?
Answers (1)
Rangesh
on 26 Sep 2023
Edited: Rangesh
on 26 Sep 2023
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:
- array indexing: https://www.mathworks.com/help/matlab/learn_matlab/array-indexing.html
- sum: https://www.mathworks.com/help/matlab/ref/sum.html
I hope this resolves your query.
Thanks,
Rangesh.
0 Comments
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!