How to calculate the distances between the transformation matriecs?
4 次查看(过去 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 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!