use of strcmp with two conditions
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
DGM
am 3 Jul. 2022
Bearbeitet: DGM
am 3 Jul. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!