我在 Sublime Text 3 中设置了一个构建系统来运行 Matlab 文件。这真的很好用:
{ "cmd": ["/usr/local/MATLAB/R2013b/bin/matlab", "-nosplash", "-nodesktop", "-nojvm", "-r\"run('$file');\"“]
问题是我想在 $file 执行后让 Matlab 在 Sublime 控制台中运行。这可能吗?
提前谢谢你。
最佳答案
好的,我终于找到了在外部 xterm 终端中运行构建系统的解决方案。如果你使用这个,Sublime 将打开一个 xterm 窗口并在那里执行构建系统。此窗口保持打开状态,因此例如执行代码后,Matlab 绘图窗口不会关闭。我将带有和不带有外部终端的构建系统合并为一个构建系统:
{
"cmd": ["/usr/local/MATLAB/R2013b/bin/matlab", "-nosplash", "-nodesktop", "-r \"run('$file');quit;\""],
"selector": "source.m",
"variants": [
{
"name": "xterm",
"cmd": ["xterm", "-e", "/usr/local/MATLAB/R2013b/bin/matlab", "-nosplash", "-nodesktop", "-r \"run('$file');\""]
}
]
}
然后分配一个用户键绑定(bind)以轻松访问 xterm 变体:
[
{ "keys": ["ctrl+shift+b"], "command": "build", "args": {"variant": "xterm"} }
]
此 xterm 解决方案还应与您希望防止在代码执行完成后关闭的任何其他解释器一起使用。
关于matlab - Sublime Text 3 构建系统 : keep console running,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23310202/