Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to run matlab in background on a linux server?
Replies: 6   Last Post: May 3, 2012 6:01 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Yuheng

Posts: 33
Registered: 1/3/11
Re: How to run matlab in background on a linux server?
Posted: Jan 5, 2011 1:49 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Steven_Lord" <slord@mathworks.com> wrote in message <ifvgjv$1du$1@fred.mathworks.com>...
>
>
> "Yuheng " <e2_71828@tom.com> wrote in message
> news:ifu0us$i02$1@fred.mathworks.com...

> > I tried a command like this:
> >
> > nohup matlab linux_try.m 1>std.out 2>err.out &
> >
> > there is only one line in the file linux_try.m, which is
> >
> > a = magic(5)
> >
> > but in std.out there are a lot of 'Warning: Error reading character from
> > command line', and in err.out there are a lot of 'Bad file descriptor'.
> >
> > Can anybody help me? Thanks a lot

>
> Try invoking MATLAB with the -r startup option.
>
> http://www.mathworks.com/help/techdoc/matlab_env/f8-4994.html
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlab.wikia.com/wiki/FAQ
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com


Thank you for your suggestion, and the link is very helpful.

With an 'exit' added to the end of the script file, the following command works very well

nohup matlab -r "linux_try" -logfile "data.log" 1>stdout.out 2>err.out &

The only small problem is, if the script is not ended with an 'exit'. Matlab will continuously output error messages such as 'Error reading character from command line' and 'Bad file descriptor' in 'data.log', 'stdout.out' and 'err.out', until the process is killed. Do you have any idea of the reason?

At last, I want to thank you again for all your help!



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2013. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.