Checking if two matrices are similar

81 次查看(过去 30 天)
How would I use Matlab to check if two matrices are similar. For example, for matrices A and B, both of dimension nxn, how do I check that the following is true: ?
  1 个评论
Yue Wang
Yue Wang 2022-4-29
I think you can check if two matrices are similar by checking their Jordan canonical forms. If they have the same structure, then the two matrices are similar. To find the Jordan canonical form of a matrix, you can use the MATLAB function
[V,J] = jordan(A)

请先登录,再进行评论。

回答(1 个)

JESUS DAVID ARIZA ROYETH
you can check with a tolerance:
tol=0.0001;%tolerance
if sqrt(sum(sum((B-S*A/inv(S)).^2)))<=tol
disp('It is true')
else
disp('It is false')
end

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by