필터 지우기
필터 지우기

the code problem

조회 수: 1 (최근 30일)
UTA
UTA 2012년 10월 1일
my question is here:
k = 1;
for i = 1:10
for j = 1:6
if(i ==1 && j == 3)
% here I just want to skip i = 10,j = 3 and continue to next i
% = 10 and j = 4,how should I do that?
else
k = k+1;
end
end
end

채택된 답변

Matt Fig
Matt Fig 2012년 10월 1일
Use the CONTINUE statement.
k = 1;
for ii = 1:10
for jj = 1:6
if(ii ==10 && jj == 3)
continue
else
k = k+1;
end
end
end

추가 답변 (1개)

Kapil Nagwanshi
Kapil Nagwanshi 2012년 10월 1일
The problem is not very clear, tell me what are the steps you want to skip, i am also confused with 'next i%10 and j=4' so here % is comment or the mod operator if it is a mod operator then try to attempt like what i just understood your code and see the breakup of your code. How one would think upon it.
%my question is here:
k = 1;
for i = 1:mod(i,10):10
for j = 1:6
if(i ==1 && j == 3)
% here I just want to skip
if(i = 10,j = 3)
%and continue to next
i % = 10 and j = 4,
% how should I do that?
else k = k+1;
end
end
%
Hope you are now able to solve the problem
% code
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