Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Compare matrices from different programs
1 回表示 (過去 30 日間)
古いコメントを表示
I have two matrices created from two different programs. Matrix A from program A and matrix B from program B. The matrix sizes are same and I want to compare the elements of these matrices. Is that possible? If yes, how?
0 件のコメント
回答 (2 件)
Jan
2017 年 2 月 21 日
If the matrices are small, you can subtract them:
A - B
abs(A- B)
If they are too large to keep the overview in the command window:
D = abs(A - B);
max(D(:))
min(D(:));
You can draw the difference:
Img = A - B;
Img = Img - min(Img(:));
Img = Img / max(Img(:)); % Normalize to [0, 1]
image(Img);
If you only want to check, if the matrices are equal:
isequal(A, B)
2 件のコメント
Rik
2017 年 2 月 21 日
Well, this is what you get from not being clear on how you precisely want to compare the matrices ;)
Jan
2017 年 2 月 22 日
@Rik: And the detail that the matrices are comming from "two different programs" has not been considered. I hope that fiona gets inspirated by our suggestions.
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!