通过命令执行完成后如何退出MATLAB? [英] How do I quit MATLAB after execution is finished through command?

查看:1029
本文介绍了通过命令执行完成后如何退出MATLAB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过命令来代替在我的.m文件中写入quit吗?我想在文件执行完成后立即关闭MATLAB.

Instead of writing quit in my .m file, can I do this through command? I want to close MATLAB right after the file execution is completed.

例如,这是我的命令

matlab -nodisplay < my_script

非常感谢您.

这是我试图执行的实际命令

This is the actual command I was trying to make

matlab -nodisplay -nodesktop -nosplash -nojvm -r "try, basic_plot;end, quit"

推荐答案

matlab -nosplash -nodesktop -r "my_script; quit"

按照Edric的建议,您最好使用其中之一:

Following Edric's recommendation, you'd better use one of these:

matlab -nosplash -nodesktop -r "try, my_script; end, quit"
matlab -nosplash -nodesktop -r "try, my_script; catch, disp('failed'), end, quit"
matlab -nosplash -nodesktop -r "try, my_script; catch e, your_error_handling_function(e), end, quit"

这篇关于通过命令执行完成后如何退出MATLAB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆