findStringInCell(C,S)
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
Cite As
Sugato (2026). findStringInCell(C,S) (https://uk.mathworks.com/matlabcentral/fileexchange/64098-findstringincell-c-s), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
