Checking if two matrices are similar

조회 수: 51(최근 30일)
Daniel Brower
Daniel Brower 2019년 12월 6일
답변: JESUS DAVID ARIZA ROYETH 2019년 12월 7일
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개)

JESUS DAVID ARIZA ROYETH
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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by