findStringInCell(C,​S)

Versione 1.0.0.0 (1,34 KB) da Sugato
This function returns the index of a string (S) in a cell array (C).
29 download
Aggiornato 12 ago 2017

Visualizza la licenza

Function Description:
This function returns the index of a string (S) in a cell array (C).

AUTHOR: Sugato Ray | Created on: 18-May-2017 | ray.sugato[at]gmail.com

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PLEASE ACKNOWLEDGE THE AUTHOR IF YOU USE THIS CODE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


INPUT:
C = Cell array
S = String to look for

OUTPUT:
Index = index of the string in the cell

EXAMPLE:
Index = findStringCell(C,S);
Index = findStringCell({'alpha','beta','x','z'},'beta'); % this returns Index = 2

Cita come

Sugato (2025). findStringInCell(C,S) (https://www.mathworks.com/matlabcentral/fileexchange/64098-findstringincell-c-s), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2016a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Characters and Strings in Help Center e MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0