Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Match matrix elements
Date: Wed, 21 Jan 2009 11:29:02 +0000 (UTC)
Organization: Erasmus MC
Lines: 52
Message-ID: <gl70tu$qru$1@fred.mathworks.com>
References: <gl4esv$t3e$1@fred.mathworks.com> <MPG.23dfc2bb167363f998992c@news.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1232537342 27518 172.30.248.35 (21 Jan 2009 11:29:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 21 Jan 2009 11:29:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 870065
Xref: news.mathworks.com comp.soft-sys.matlab:512876

Loren Shure <loren@mathworks.com> wrote in message <MPG.23dfc2bb167363f998992c@news.mathworks.com>...
> In article <gl4esv$t3e$1@fred.mathworks.com>, bobbaNO@mfn.SPAM.unipmn.it 
> says...
> > Hi, I have two matrix A and B:
> > 
> > A = 43000000 x 5
> > B = 1 x 5
> > 
> > I show an example to clarify the target:
> > 
> > A = [11 22 34 56 89             B = [11 66 44 40 90}
> >        23 44 11 20 66
> >        79 54 32 17 89
> >        11 66 21 45 90
> >         ... ... ... ... ...]
> > 
> > RESULTS = [1 0 0 0 0
> >                   0 1 1 0 1
> >                   0 0 0 0 0
> >                   1 1 0 0 1
> >                   .. .. .. .. ..]
> > 
> > I would like to build a matrix (RESULTS) in which appears 1 if an element of B is present in A and zero if not present.
> > I used "ismember" function but the error HELP OF MEMORY appears.
> > 
> > Can you help me to solve problems in a short time?
> > 
> > Thanks
> > 
> > Marco
> > 
> > 
> 
> You inspired me to blog on this topic: 
> http://blogs.mathworks.com/loren/2009/01/20/more-ways-to-find-matching-
> data/
> 
> The short answer is:
> 
> FinalAnswer = ismember(A,B)
> 
> will get you the results you are looking for.
> 
> 
> -- 
> Loren
> http://blogs.mathworks.com/loren

Perhaps I have missed something but I assumed the problem was that the OP tried ISMEMBER but ran into memory issues?

Jos