0

Here is my cell array which is 2x2.

A = {'34TA894' 'Some string goes here.' ; '06AC532' 'Some string goes here too.'}

I am trying to find which row of the cell contains 34TA894. I tried to use find function as intended but it did not work. I've tried to convert my cell into a matrice to use it in the find function.But it gave me error "Matrice dimensions must agree."

Pyro
  • 17
  • 10
  • 2
    The documentation for [`strfind`](http://www.mathworks.com/help/matlab/ref/strfind.html) contains one approach. – sco1 Jan 17 '16 at 20:14

1 Answers1

0
[row,col]=find(strcmp(A,'34TA894'));

strcmp(s1,s2) compares s1 and s2 and returns a boolean matrix indicating where they are identical.

strcmpi(s1,s2) is the same as strcmp except it is case insensitive.

strfind(str,pattern) compares s1 and pattern and returns a cell array of indices indicating the locations of pattern within each element of str.