Checking if two matrices are similar
34 ビュー (過去 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:
?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/253350/image.png)
1 件のコメント
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
2019 年 12 月 7 日
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
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!