dog = {1,'cat'}Index = find(contains(dog,'cat'))
MATLAB: Find index of an arbitrary cell array that contains a string
cell arraysfind
In This thread, @Jan answers the question in the title for the case of cell arrays that consist only of character variables.
It doesn't work for more cell arrays that contain numbers and variables, e.g.,
returns an error. Could somebody explain the solution for the case of general arrays? Thanks
Related Question
- Manipulation of a cell array-
- Find index of cells containing a string
- How do i break a string down into cell arrays containing a string
- Does STRMATCH in MATLAB cause an error for a cell array containing a numeric value
- Find cell containing part of a string.
- Using strcmp on nested cell array (cell array within a cell array)
Best Answer