how to jump a single for step in a for loop?

조회 수: 15 (최근 30일)
Shubham Mohan Tatpalliwar
Shubham Mohan Tatpalliwar 2019년 2월 5일
I am writing a code for fuel consumption for that i want to use a for loop which calculates Speed of the motor
for k=1:1:150
Speed = k*100
if Speed <1000
% At this point i want to jump this for step
end
torque=15
FuelConsumption=Speed*torque
end
As we can directly catch that i can also start from 10 to avoid this problem
But the same Speed i am using for further calculation where i need the values less than 1000 too.
  댓글 수: 5
KSSV
KSSV 2019년 2월 5일
Read about continue
Shubham Mohan Tatpalliwar
Shubham Mohan Tatpalliwar 2019년 2월 5일
thats the perfect solution
thanx alot

댓글을 달려면 로그인하십시오.

채택된 답변

madhan ravi
madhan ravi 2019년 2월 5일
if ...
continue % just add this inbetween
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by