我可以在带有 UI 的 Windows 上运行 matlab,只是代码在远程服务器上运行吗?
我正在使用我的笔记本电脑来运行 MATLAB,它非常方便,但速度很慢。 我们拥有运行 MATLAB 的强大服务器,但对我来说,在笔记本电脑上使用 UI 运行应用程序更方便(而不是通过命令行运行 Matlab)。
是否可以通过 UI 在 Windows 上本地运行 matlab,只是代码在远程服务器上运行(从而更快)?
谢谢!
I am using my laptop to run MATLAB and it's very convenient but SLOW.
We have strong servers that run MATLAB but it's more convenient for me to run the application with UI on my laptop (as opposed to say running Matlab through command line).
Is it possible to run matlab on Windows, locally, with UI, just that the code runs on a remote server (and thus quicker)?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想到了几个选项,但并非所有选项都能准确回答您提出的问题。鉴于您的笔记本电脑是 Windows,您可以执行以下操作之一:
matlabpool
。选项 (1) 和 (2) 基本上意味着您通过线路将 MATLAB UI 传输到笔记本电脑。选项 (3) 与您最初要求的最相似,但是
matlabpool
仅运行PARFOR
和SPMD
块的主体服务器。Several options spring to mind, not all of which answer the precise question that you posed. Given that your laptop is Windows, you could do one of these things:
matlabpool
on the server.Options (1) and (2) basically mean you're transmitting the MATLAB UI over the wire to your laptop. Option (3) is sort-of most like what you originally asked for, but the
matlabpool
only runs the body ofPARFOR
andSPMD
blocks on the server.详细介绍了如何在没有 GUI 的服务器上启动 MATLAB
http://blogs.mathworks.com/桌面/2010/02/22/启动-matlab-without-the-desktop/
您还应该阅读那里的用户评论/讨论
,例如你可以使用
如果不使用 Java 对于您的需求来说限制太多:
那里的讨论还谈到使用未记录的 com.mathworks.mde.desk.MLDesktop.getInstance.getMainFrame.hide 来隐藏命令行窗口,但该命令似乎不起作用
BTW,您可以作为 COM 自动化服务器启动,而不是通过 Windows shell 命令启动 MATLAB:
http://www.mathworks.com/help/techdoc/matlab_external/brd0v3w.html
或通过现有 C API 启动 MATLAB:
http://www.mathworks.com/help/techdoc/matlab_external/f29148.html
如果您经常使用此功能(例如从 Web 服务),最好始终在内存中保留 MATLAB 实例(因为 Windows 应用程序共享代码并具有单独的数据,这可以通过避免重新加载来节省大量时间)每次运行脚本时将 MATLAB 代码写入内存)。在服务器启动时使用此命令,该实例也可以是无头的(没有 UI)(例如,通过使用“regedit.exe”在 Windows 注册表中的 HKLM/Software/Microsoft/Windows/CurrentVersion/Run 添加条目)
:启动 matlab -nosplash -nodesktop -nojvm -minimize
Launching MATLAB on a server without the GUI is covered thoroughly at
http://blogs.mathworks.com/desktop/2010/02/22/launching-matlab-without-the-desktop/
you should also read the user comments/discussion there
e.g. you can use
if not using Java is too restrictive for your needs:
The discussion there also speaks of using the undocumented com.mathworks.mde.desk.MLDesktop.getInstance.getMainFrame.hide to hide the command-line window, but that command doesn't seem to work
BTW, instead of launching MATLAB via Windows shell command you could launch as a COM automation server:
http://www.mathworks.com/help/techdoc/matlab_external/brd0v3w.html
or via existing C API for launching MATLAB:
http://www.mathworks.com/help/techdoc/matlab_external/f29148.html
If you use this often (e.g. from a web service), it is best that you keep an instance of MATLAB in memory all the time (since Windows apps for example share code and have separate data this can spare much time by avoiding the reloading of MATLAB code into memory at every script run). That instance could be headless too (with no UI) using this command at server boot (e.g. by adding an entry at HKLM/Software/Microsoft/Windows/CurrentVersion/Run in the Windows registry using "regedit.exe"):
start matlab -nosplash -nodesktop -nojvm -minimize