How to calculate the distances between the transformation matriecs?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
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 ?
답변 (1개)
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:
- 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
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!