sublime配置matlab 图形不闪退


{
    "cmd": ["D:\\Program Files\\MATLAB\\R2023b\\bin\\matlab.exe", "-nodesktop", "-nosplash", "-r", "run('$file'); uiwait;"],
    "selector": "source.matlab",
    "working_dir": "$file_path",
    "shell": true
}


% 你的绘图代码
x = 0:0.1:10;
y = sin(x);
f = figure;  % 必须创建窗口
plot(x,y);
grid on;

% 最后一行必须加这个!!
uiwait(f);   % 等待关闭图窗才会退出

posted @ 2026-03-22 03:12  redufa  阅读(2)  评论(0)    收藏  举报