PDA

View Full Version : MATLAB: Matrix diff


Tomgg
Aug27-11, 06:40 PM
In a Linux shell there's an incredibly useful utility called "diff" that compares two files, A and B say, then returns all of their differences.

I'm looking for a MATLAB command that returns the differences of two supplied matrices of admissible dimension.

The above is possibly overwhelmingly passive, so here is an illustrative example:

A= [1,2.3;1,2,3];
B=[1,2,3;1,2,3;1,2,2];

diff(A,B) would then return [1,2,2].

Cheers!