matlab中如何终止正在运行的进程?

发布于 2024-09-02 01:25:34 字数 102 浏览 6 评论 0原文

我有一个非常简单的问题:如何使用代码终止 matlab 中正在运行的脚本,类似于使用 CTRL + C

如果用户输入不正确的数字,我希望程序停止运行。

I have a pretty simple question: how can I terminate a running script in matlab using code, similar to using CTRL + C?

I want the program to stop running if a user enters incorrect digits.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

司马昭之心 2024-09-09 01:25:34

如果处于调试模式,您可以使用dbquit。如果您位于主函数中,return 将终止并返回。否则使用error函数。

If in debug mode, you can use dbquit. if you're in the main function, return terminates and returns. Otherwise use the error function.

迷爱 2024-09-09 01:25:34

使用error函数。有关详细信息,请参阅文档错误

Use the error function. See doc error for more information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文