我可以在带有 UI 的 Windows 上运行 matlab,只是代码在远程服务器上运行吗?

发布于 2024-09-06 20:32:27 字数 186 浏览 9 评论 0原文

我正在使用我的笔记本电脑来运行 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 技术交流群。

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

发布评论

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

评论(2

铃予 2024-09-13 20:32:27

我想到了几个选项,但并非所有选项都能准确回答您提出的问题。鉴于您的笔记本电脑是 Windows,您可以执行以下操作之一:

  1. 使用远程桌面连接到服务器并在那里运行 MATLAB
  2. 如果服务器是 UNIX,您可以在您的笔记本电脑上运行 X 服务器(有一个带有 cygwin 的免费服务器)
  3. 您可以使用并行计算工具箱MATLAB 分布式计算服务器 在服务器上打开 matlabpool

选项 (1) 和 (2) 基本上意味着您通过线路将 MATLAB UI 传输到笔记本电脑。选项 (3) 与您最初要求的最相似,但是 matlabpool 仅运行 PARFORSPMD 块的主体服务器。

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:

  1. Use remote desktop to connect to the server and run MATLAB there
  2. If the server is UNIX, you could run an X server on your laptop (there's a free one with cygwin)
  3. You could use the Parallel Computing Toolbox and MATLAB Distributed Computing Server to open a 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 of PARFOR and SPMD blocks on the server.

回忆躺在深渊里 2024-09-13 20:32:27

详细介绍了如何在没有 GUI 的服务器上启动 MATLAB
http://blogs.mathworks.com/桌面/2010/02/22/启动-matlab-without-the-desktop/
您还应该阅读那里的用户评论/讨论

,例如你可以使用

启动 matlab -nosplash -nodesktop -nojvm -minimize -r
“测试命令,退出”

如果不使用 Java 对于您的需求来说限制太多:

关于“-nodesktop”与“-nojvm”,还有第三种
(未记录/不受支持)选项:“-noawt”。 -noawt 加载 Java(因此
启用 Java I/O、数据结构等)并且只是阻止 Java GUI

那里的讨论还谈到使用未记录的 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

start matlab -nosplash -nodesktop -nojvm -minimize -r
"testcommand,quit"

if not using Java is too restrictive for your needs:

Regarding ‘-nodesktop’ vs. ‘-nojvm’, there is a third
(undocumented/unsupported) option: ‘-noawt’. -noawt loads Java (thus
enabling Java I/O, data structures etc.) and just prevents Java GUI

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

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