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!