Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Get line index on matrix
Date: Fri, 6 Nov 2009 07:39:02 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 42
Message-ID: <hd0jqm$67p$1@fred.mathworks.com>
References: <hcudtq$phk$1@fred.mathworks.com> <hd0j46$n1i$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257493142 6393 172.30.248.37 (6 Nov 2009 07:39:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 6 Nov 2009 07:39:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:582940


"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <hd0j46$n1i$1@fred.mathworks.com>...
> Replace ISMEMBER call with ISMEMBERF on FEX:
> 
> http://www.mathworks.com/matlabcentral/fileexchange/23294-ismemberf
> 
> Bruno

Example:

>> vector=[1 3 16;
                  2 7 12;
                  13 1 73]*(1/10)

vector =

    0.1000    0.3000    1.6000
    0.2000    0.7000    1.2000
    1.3000    0.1000    7.3000

>> [t idx]=ismember([0.2 0.7 1.2],vector,'rows') % <- exact comparison

t =

     0


idx =

     0

>> [t idx]=ismemberf([0.2 0.7 1.2],vector,'rows')

t =

     1


idx =

     2

% Bruno