comparing two matrices

Francesco Cat heartcollector87 at gmail.com
Tue Jul 22 03:00:32 CDT 2008


I would do it by:

Diff = !(A == B)

but be carefull because you must use integers or the floating point
precision could easily create false positives


2008/7/22 Goebel, Juergen <juergen.goebel at eads.com>:
> Hi,
>
> I'd like to compare two row (or column) matrices
> and get a resulting matrix in which the different
> positions are marked by a one, e.g.
>
> A = [0 1 2 3 0 1 2 3]
> B = [0 0 2 3 0 1 2 2]
>
> result: [0 1 0 0 0 0 0 1]
>
> How do I achieve this?  (I already played a bit
> with the find-function but without success.)
>
> Regards,
>
> Juergen
>
> _______________________________________________
> Help-octave mailing list
> Help-octave at octave.org
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>
>


More information about the Help-octave mailing list