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

采纳的回答

Bruno Luong
Bruno Luong 2020-7-20
Change to
...
if strcmp(S(i).Status,'Active') || strcmp(S(i).type,'N')
...
end

更多回答(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