use of strcmp with two conditions
조회 수: 5 (최근 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!