文档帮助中心
本页对应的英文页面已更新,但尚未翻译。 若要查看最新内容,请点击此处访问英文页面。
将正在运行的 MATLAB 会话转换为共享会话
matlab.engine.shareEngine
matlab.engine.shareEngine(name)
示例
matlab.engine.shareEngine 将当前 MATLAB® 会话转换为具有默认名称的共享会话。默认名称为 'MATLAB_<process_ID>',其中 <process_ID> 是指示当前 MATLAB 会话的进程 ID 的数字。
'MATLAB_<process_ID>'
<process_ID>
matlab.engine.shareEngine(name) 将当前 MATLAB 会话转换为共享会话,并为其赋予指定的名称。
name
如果您的本地计算机上已有具有指定名称的共享 MATLAB 会话,则 matlab.engine.shareEngine 会将当前会话转换为具有默认名称的共享会话。
全部折叠
将当前 MATLAB 会话转换为具有默认名称的共享会话。
matlab.engine.shareEngine matlab.engine.engineName
ans = MATLAB_49593
matlab.engine.shareEngine 为共享会话赋予默认名称 MATLAB_49593,其中 49593 是 MATLAB 会话的进程 ID。您每次启动 MATLAB 时,该进程 ID 都是不同的。
MATLAB_49593
为当前 MATLAB 会话赋予名称并共享该会话。
matlab.engine.shareEngine('Engine_1') matlab.engine.engineName
ans = Engine_1
共享 MATLAB 会话的名称,指定为字符数组或字符串。name 必须是有效的 MATLAB 变量名称。有关有效名称的信息,请参阅变量名称。
数据类型: char | string
char
string
已部署的应用程序不支持 matlab.engine.shareEngine。
您也可以使用 MATLAB 启动选项启动共享会话。要启动 MATLAB 共享会话,请在操作系统提示符下键入此命令:
matlab -r "matlab.engine.shareEngine"
matlab.engine.engineName | matlab.engine.isEngineShared
matlab.engine.engineName
matlab.engine.isEngineShared
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office