how to use "or"
조회 수: 4 (최근 30일)
이전 댓글 표시
Can u pls tell me what is wrong ( just an example) How do i use the or command ?
for i = 1:100
if i == 2|5
disp('hallo')
end
end
댓글 수: 0
채택된 답변
추가 답변 (1개)
Andrei Bobrov
2014년 8월 5일
for ii = 1:100
if ii == 2 || ii == 5
ii
disp('hallo')
end
end
or
for ii = 1:100
if ismember(ii,[2,5])
disp('hallo'),ii
end
end
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!