How can I tell matlab it's running in the background?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Leo Simon
am 11 Mär. 2013
Kommentiert: Leo Simon
am 14 Apr. 2014
I'd like to be able to run a job either in the background or in the foreground. My program runs fine in the foreground but crashes in the background, presumably because it's not seeing some environment variable. The command that causes the crash is useful only for foreground applications (it relates to screen output) so I could easily avoid this problem if I could flag whether or not the program is running in the foreground. So my question is: does matlab know if it's being run as a foreground or background application, and if yes, what variable would indicate this?
Thanks for any advice
2 Kommentare
Jason Ross
am 11 Mär. 2013
Can you clarify which operating system you are using?
And say exactly how are you get getting "foreground" and "background", e.g. you hit control-z, use nohup, launch from the command line with switches, use a job scheduler, etc.
Akzeptierte Antwort
Jason Ross
am 1 Apr. 2013
I would run "system(env)" in both modes, put the output to a file, and diff them.
I have a sneaking suspicion that the difference is tied to the DISPLAY environment variable.
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!