use of strcmp with two conditions
4 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (2 件)
DGM
2022 年 7 月 3 日
編集済み: DGM
2022 年 7 月 3 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!