MATLAB 中的跳转命令 [英] Jump command in MATLAB
本文介绍了MATLAB 中的跳转命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 MATLAB 的 m 文件编辑器,我需要从一行跳转到另一行.如果我需要从 For
...end
内部跳转,我不能使用通常的while"技术.
无论如何,是否可以从一行跳转到另一行,例如 C 中的 goto
?
解决方案
MATLAB 中没有 goto
语句,但还有一些其他用于循环的命令可能会对您有所帮助:>
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?
解决方案
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.
这篇关于MATLAB 中的跳转命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文