フィルターのクリア

Problem running matlab in batch mode: Connection to X11 server lost, then runaway log file.

2 ビュー (過去 30 日間)
Aaron Schurger
Aaron Schurger 2012 年 1 月 5 日

I am running MatLab 2010b on Ubuntu Linux.

Every time I run my batch script using matlab -r on the Linux command line, the script appears to run to completion, but then (in the log file, after all of the script output) I get the following error:

 Warning:
Connection to the X11 Display Server (:0.0) has been lost.
No more graphics windows can no longer be displayed in this session.
Graphics Objects can still be printed, and all commands should still work.
We recommend that you try to save your current session and exit 
> In run_sim_output_cbrn at 12
??? Operation terminated by user during ==> run_sim_output_cbrn at 12
 >> Invalid file descriptor
Invalid file descriptor
Invalid file descriptor
Invalid file descriptor
Invalid file descriptor
etc....

The phrase "Invalid file descriptor" is output continuously until my disk is full (creating an enormous log file).

At first I ran the script like this:

 > nohup matlab -nojvm -r batch_script.m -logfile batch.log &

Then I tried it again by putting the matlab command (matlab -nojvm -r batch_script.m -logfile batch.log) in a shell script called run_matlab_batch.cmd and then doing

 > nohup run_matlab_batch.cmd &

In both cases I end up with the same problem (nohup.out and batch.log grow with "Invalid file descriptor" until the disk gets full and the process crashes).

Thanks for any help on this one.

Aaron Schurger

回答 (2 件)

Walter Roberson
Walter Roberson 2012 年 1 月 5 日
Surround your code with a try/catch block (with no action in the catch), and follow it with quit
The try/catch ensures that the quit will be executed even if your program encounters a problem such as the "invalid file descriptor".
  1 件のコメント
Aaron Schurger
Aaron Schurger 2012 年 1 月 5 日
I should have mentioned that I already did precisely that, but to no avail. Same problem.
Any other suggestions?
Thanks, though.

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


Laurence Lurio
Laurence Lurio 2012 年 6 月 10 日
Look at http://www.math.ufl.edu/help/matlab/tec1.1.html I think this is an alternative solution that worked for me (although I had to comment out the DISPLAY stuff)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by