Let's search the cell array and find the index. This simple example will help to find the index in cell array of large size.
names={'Hilda' 'Helen' 'Ada'; 'Matthew' 'Jenny' 'Justin'; 'Agnes' 'Merlin' 'Mark';}
names = 
    'Hilda'      'Helen'     'Ada'   
    'Matthew'    'Jenny'     'Justin'
    'Agnes'      'Merlin'    'Mark'  
I need to know whether the name 'Justin' exists in this cell array
find(strcmp(names,'Justin')==1)
ans =
     8
Let me retrieve the name 'Justin'  , using the index
names{8}
ans =
Justin
 
 :)
:)
 :(
:(
 :))
:))
 :((
:((
 =))
=))
 =D>
=D>
 :D
:D
 :P
:P
 :-O
:-O
 :-?
:-?
 :-SS
:-SS
 :-f
:-f
 d(
d(
 :-*
:-*
 b-(
b-(
 h-(
h-(
 g-)
g-)
 5-p
5-p
 y-)
y-)
 c-)
c-)
 s-)
s-)
 d-)
d-)
 w-)
w-)
 :-h
:-h
 :X
:X



0 comments:
Enjoyed Reading? Share Your Views