replacement for findstr

11 visualizzazioni (ultimi 30 giorni)
G
G il 25 Ago 2011
findstr('text', guidata.dataFile{1,1}.header{i})
header{i} is a 1x4 char (in this example named text)
I have a loop that dynamically generates radio button position and color based on a header row. What I have now works fine but because findstr seems to be on the chopping block I am trying to update the code. I have tried strncmp and regexp but can't seem to figure it out.
Any help is appreciated.

Risposte (1)

Jan
Jan il 25 Ago 2011
Do your mean STRFIND?
  9 Commenti
Jan
Jan il 25 Ago 2011
FINDSTR had the risky feature that the shorter string is searched in the longer one. If you want to look for the position of 'one' inside 'stone', the reply of FINDSTR will be surprising, if the 2nd string is 'e'.
MATLAB 2009a still ontained several dangerous FINDSTR calls. Perhaps they are replaced by STRFIND now, which searches the 2nd string inside the first one.
Jan
Jan il 25 Ago 2011
FINDSTR had the risky feature that the shorter string is searched in the longer one. If you want to look for the position of 'one' inside 'stone', the reply of FINDSTR will be surprising, if the 2nd string is 'e'.
MATLAB 2009a still ontained several dangerous FINDSTR calls. Perhaps they are replaced by STRFIND now, which searches the 2nd string inside the first one.

Accedi per commentare.

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by