Running MATLAB from Mac Automator

2 次查看(过去 30 天)
When I run MATLAB from a Terminal window with this command
/Applications/MATLAB_R2014a.app/bin/matlab
it opens MATLAB normally.
I have been experimenting with Automator to open MATLAB as part of a workflow. Inside Automator, I choose "Run Shell Script" and put the above command inside the script.
I then run the application. It definitely opens MATLAB -- the splash screen appears -- but then it shuts down immediately, presumably because the script is completing and exiting. Anyone know how to get MATLAB to stay open in this situation?

采纳的回答

Ken Atwell
Ken Atwell 2014-3-25
Two possibilities to try:
  • Add -desktop to the command line invocation of MATLAB
  • Add & to the end of the command line to fork the MATLAB process
  2 个评论
the cyclist
the cyclist 2014-3-25
Thanks, Ken. (Had a suspicion you would step in here!)
I tried the ampersand already, to no avail, but I'll try the -desktop as well.
the cyclist
the cyclist 2014-3-26
编辑:the cyclist 2014-3-26
Using "-desktop" did it! Thanks.
Just because you may be interested in why ...
I was doing it to see if I could get around the blurry rendering on Retina displays that recent versions of MATLAB have.
The answer there only works for MATLAB called from a shell, so I wanted to try it, but using automator to call the shell from the dock.
Added these lines to the bash script:
export MATLAB_JAVA="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home"
/Applications/MATLAB_R2014a.app/bin/matlab -desktop
and voila, crisp MATLAB again!

请先登录,再进行评论。

更多回答(1 个)

florian
florian 2014-4-3
I created the following based on your work - thank you guys! http://www.mathworks.com/matlabcentral/answers/102946#answer_131990

类别

Help CenterFile Exchange 中查找有关 Desktop 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by