필터 지우기
필터 지우기

how to use "or"

조회 수: 1 (최근 30일)
Max Müller
Max Müller 2014년 8월 5일
답변: Andrei Bobrov 2014년 8월 5일
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

채택된 답변

the cyclist
the cyclist 2014년 8월 5일
for i = 1:100
if (i == 2)|(i == 5)
disp('hallo')
end
end

추가 답변 (1개)

Andrei Bobrov
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

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by