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)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!