Matlab opens gui even with -nosplash and -nodesktop on linux

16 ビュー (過去 30 日間)
Leo
Leo 2025 年 10 月 8 日 9:07
コメント済み: Leo 2025 年 10 月 13 日 9:38
Hi,
I am running latest matlab in WSL2 (on windows 10) and every time I try to run without GUI, i.e. using any combination of -nodisplay, -nodesktop, -nosplash, -nojvm, or even in case -batch matlab tries to open GUI. Because I run wsl, I cannot simply use that. How do I run without needing graphics?

回答 (1 件)

Anjaneyulu Bairi
Anjaneyulu Bairi 2025 年 10 月 13 日 9:00
編集済み: Anjaneyulu Bairi 2025 年 10 月 13 日 9:00
Here are some steps you can try to run MATLAB in true headless mode:
1. Use the -batch Option
The -batch flag is the recommended way to run MATLAB scripts non-interactively and without any GUI:
matlab -batch "your_script"
This should execute your script and exit without opening any GUI windows.
2. Unset the DISPLAY Environment Variable
Before launching MATLAB, make sure the DISPLAY environment variable is unset. This prevents MATLAB from trying to connect to an X server:
unset DISPLAY
matlab -nodesktop -nosplash -r "your_script;exit"
Hope this helps!
  1 件のコメント
Leo
Leo 2025 年 10 月 13 日 9:38
Thanks, the latter works

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2025b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by