MATLAB Answers

Checking if two matrices are similar

3 views (last 30 days)
Daniel Brower
Daniel Brower on 6 Dec 2019
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: ?

  0 Comments

Sign in to comment.

Answers (1)

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH on 7 Dec 2019
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 Comments

Sign in to comment.

Sign in to answer this question.

Products


Release

R2019b