Starting a new instance of MATLAB with the system/unix call
2 次查看(过去 30 天)
显示 更早的评论
Hello!
I have a compiled/deployed Matlab application, that needs to give the user the ability to launch a local copy of their MATLAB, while still letting the compiled application function.
I have tried doing this:
system('/opt/matlab/bin/matlab &')
Doing so just causes the splash screen to appear, then close, and no instance of MATLAB appears.
If I try it without the "&", a matlab instance does appear, but it blocks execution of my program until Matlab is closed.
From what I have researched and tried, the "matlab" file in that directory is actually a script, not the real executable. This would make sense as to why my program is experiencing the issue. I did something similar for a Windows application, and found the real executable was the matlabroot/bin/win64/MATLAB.exe but I can not find this (or similar) on Linux.
Thanks for any assistance.
Edit: I did find, inside the bin folder, the glnxa64 folder. That does contain a lot of executable files, but the only one I found that might be the true Matlab executable is matlab_helper. Attempting to run that throws a message:
"The matlab_helper program is not meant to be run outside the context of MATLAB. When forked by MATLAB at startup, this program serves as an agent for any shell commands run using ! or unix(), allowing them to run in less memory than would be required if MATLAB were to fork for each command."
It seemed close to what I needed, but not quite.
Update: After looking closer into the matlab script, I figured out a way to get it to work. If anyone is reading this in the future:
system('/opt/matlab/bin/matlab -desktop &')
Will do what you need.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!