help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Comparing vectors


From: Jaroslav Hajek
Subject: Re: Comparing vectors
Date: Mon, 25 Jan 2010 07:51:32 +0100



On Mon, Jan 25, 2010 at 6:14 AM, Mike B. <address@hidden> wrote:
Hi All,

Would appreciate help cracking this:

I have two matrices of row vectors  A ( n X d ) and B ( m X d ), n>m . In both matrices the vectors are binary, that is, each component is either 0 or 1.

What is an efficient way to find which vectors from B are already in A, for example,
A( 2, : ) equals B( 4, : ) etc. For each row in B I need the corresponding row from A.

Thanks,
Mike.



[C, I]  = intersect (B, A, "rows");

--
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

reply via email to

[Prev in Thread] Current Thread [Next in Thread]