Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
376 views
in Technique[技术] by (71.8m points)

goto - Jump command in MATLAB

I'm working with the m-file editor of MATLAB and I need to jump from one line to another. If I need to jump from inside a For...end, I can't use the usual "while" technique.
Is there anyway to jump from a line to another, like goto in C?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is no goto statement in MATLAB, but there are a few other commands for use with loops that may help you:

  • continue: This statement will skip the remaining commands in a for or while loop and move on to the next iteration.
  • break: This statement will terminate execution of a for or while loop.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...