필터 지우기
필터 지우기

For loop with string comparison

조회 수: 2 (최근 30일)
HABILA
HABILA 2020년 7월 20일
댓글: HABILA 2020년 7월 20일
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

채택된 답변

Bruno Luong
Bruno Luong 2020년 7월 20일
Change to
...
if strcmp(S(i).Status,'Active') || strcmp(S(i).type,'N')
...
end
  댓글 수: 1
HABILA
HABILA 2020년 7월 20일
This one worked, Thank U so much.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by