필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

more for loop help

조회 수: 3 (최근 30일)
James
James 2011년 8월 7일
마감: MATLAB Answer Bot 2021년 8월 20일
for c = 11:20
if c~=11 && c~=14 && c~=17 && c~=20
break
end
% how can I loop through for all values of r, which are r=11,14,17,20????
end

답변 (2개)

bym
bym 2011년 8월 7일
for k = 11:3:20
%do stuff
end

Walter Roberson
Walter Roberson 2011년 8월 7일
Or you could use
for k = [11,14,17,20]
%do stuff
end

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by