Characters linear search
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
sir i need to store characters like (man cat red blue) in 2X2 matrix and then i need to perform linear search , that is if i give man it must result man is first character please help in coding
0 Kommentare
Akzeptierte Antwort
Andrew Newell
am 28 Mär. 2011
>> A = {'man', 'cat'; 'red', 'blue'}'
A =
'man' 'red'
'cat' 'blue'
>> i = find(strcmp('man',A));
This gives the indices so that
A{i}
returns
ans =
man
( edited to respond to comment )
4 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!