This question is closed. Reopen it to edit or answer.
Compare matrices from different programs
1 view (last 30 days)
Show older comments
fiona rozario on 21 Feb 2017
Closed: MATLAB Answer Bot on 20 Aug 2021
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?
Jan on 21 Feb 2017
If the matrices are small, you can subtract them:
A - B
If they are too large to keep the overview in the command window:
D = abs(A - B);
You can draw the difference:
Img = A - B;
Img = Img - min(Img(:));
Img = Img / max(Img(:)); % Normalize to [0, 1]
If you only want to check, if the matrices are equal:
Jan on 22 Feb 2017
@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!