use of strcmp with two conditions
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi
I am wondering whats wrong with this code:
filtered=(min_tabell(strcmp(min_tabell.best_salt_1_n_best_salt_2,'NH4Cl',:)||(strcmp(min_tabell.best_salt_1_n_best_salt_2,'NaCl',:))))
the error that I get
Undefined function or variable 'strcmp'.
0 comentarios
Respuestas (2)
DGM
el 3 de Jul. de 2022
Editada: DGM
el 3 de Jul. de 2022
Just a guess, since I have no idea what your array content or size are.
strcmp() takes two arguments, but you're feeding it two arguments while simultaneously trying to index into it like an array.
things = {'b','a','NH4Cl'}
filtered_ok = strcmp(things,'NH4Cl')
filtered_bad = strcmp(things,'NH4Cl',:)
If you're trying to select all columns of the selected rows in min_tabell, then do that outside the calls to strcmp().
0 comentarios
Ver también
Categorías
Más información sobre Characters and Strings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!