Path: news.mathworks.com!not-for-mail
From: "Jerry " <jerrycholo@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: ismember
Date: Thu, 14 Nov 2013 18:04:06 +0000 (UTC)
Organization: Merck &#38; Co
Lines: 51
Message-ID: <l633am$3cj$1@newscl01ah.mathworks.com>
References: <l5ujhm$et9$1@newscl01ah.mathworks.com> <l5ulh7$a14$1@newscl01ah.mathworks.com> <l5unmh$6b3$1@newscl01ah.mathworks.com> <l5uoiq$ghj$1@newscl01ah.mathworks.com> <l604i6$arn$1@newscl01ah.mathworks.com> <l61oll$f90$1@newscl01ah.mathworks.com> <l62nt2$mu0$1@newscl01ah.mathworks.com>
Reply-To: "Jerry " <jerrycholo@gmail.com>
NNTP-Posting-Host: rubyext-05-ls.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1384452246 3475 172.20.102.181 (14 Nov 2013 18:04:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 14 Nov 2013 18:04:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3533139
Xref: news.mathworks.com comp.soft-sys.matlab:805279

Thank you for all the comments.  Yes, you are right; to clarify everything I generated exact data structure that I have; R is a cell (5-by-7) and N is also a cell (4-by1):

R = 

    'rte'    '345'    '---'    '---'    'rte'    '345_rt'    '---'   
    'wer'    '123'    '---'    '---'    'wer'    '683_iu'    '234_tr'
    'ytr'    '476'    '543'    '467'    'ytr'    '987_kj'    '---'   
    'poi'    '890'    '343'    '---'    'poi'    '873_mn'    '875_jh'
    'uyt'    '345'    '---'    '---'    'uyt'    '234_io'    '---'   

N = 

    '345'
    '476'
    '467'
    '343'

D = ismember(R, N)

D =

     0     1     0     0     0     0     0
     0     0     0     0     0     0     0
     0     1     0     1     0     0     0
     0     0     1     0     0     0     0
     0     1     0     0     0     0     0

 x = R(D, :)
Index exceeds matrix dimensions.


D2 = ismember(R, N, 'rows')
Warning: Third argument is ignored for cell arrays. 

> In cell.ismember at 22 

D2 =

     0     1     0     0     0     0     0
     0     0     0     0     0     0     0
     0     1     0     1     0     0     0
     0     0     1     0     0     0     0
     0     1     0     0     0     0     0

R2 = R(D2, :)
Index exceeds matrix dimensions.

Please let me know how I could get output based on these inputs using "ismember" or any other function.

Thanks,
Jerry