comparing two matrices
Jaroslav Hajek
highegg at gmail.com
Tue Jul 22 02:58:30 CDT 2008
On Tue, Jul 22, 2008 at 9:32 AM, Goebel, Juergen
<juergen.goebel at eads.com> wrote:
> 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.)
>
it's intuitive:
result = A != B
this creates a "logical" matrix. Usually that's perfectly suitable but
occassionally you may want to convert it to another type using, e.g.
"double" or "int"
> Regards,
>
> Juergen
>
> _______________________________________________
> Help-octave mailing list
> Help-octave at octave.org
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>
>
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
More information about the Help-octave
mailing list