For loop with string comparison
조회 수: 2 (최근 30일)
이전 댓글 표시
I am getting error with this code. Can someone help me with this ?
for i=1:100
if (S(i).Status=='Active' || S(i).type=='N')
disp(i)
else
continue;
end
end
댓글 수: 0
채택된 답변
Bruno Luong
2020년 7월 20일
Change to
...
if strcmp(S(i).Status,'Active') || strcmp(S(i).type,'N')
...
end
추가 답변 (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!