Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to run matlab in background on a linux server?

Subject: How to run matlab in background on a linux server?

From: Yuheng

Date: 4 Jan, 2011 02:34:04

Message: 1 of 4

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

Subject: How to run matlab in background on a linux server?

From: Steven_Lord

Date: 19 Apr, 2011 13:19:08

Message: 2 of 4



"Siyanda Nazo" <siyanda.nazo@gmail.com> wrote in message
news:iojf8e$1gs$1@fred.mathworks.com...
> Hi all
>
> I am also trying to run a matlab file on the linux command line and have
> encountered the same problems. The line I enter on the command line is:
>
> nohup matlab -nojvm -r "My_script" > My_script_out.txt&
>
> I have placed the exit command at the end of the file 'My_script' but
> Matlab seems to go into a never ending loop and prints 'bad file
> descriptor' in the output file when it finishes executing the matlab
> script. Has anyone encountered this problem and if so, what is the
> solution?

I'm not certain -- you should contact Technical Support for help determining
the cause of this behavior.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: How to run matlab in background on a linux server?

From: Anna

Date: 30 Jan, 2012 08:39:10

Message: 3 of 4

Hi!
I have solved this issure by typing:

nohup matlab -nojvm -r name_of_your_script_without_extension -logfile name_of_logfile.out </dev/null &

Cheers,
Anna

"Steven_Lord" <slord@mathworks.com> wrote in message <iok23p$amv$1@fred.mathworks.com>...
>
>
> "Siyanda Nazo" <siyanda.nazo@gmail.com> wrote in message
> news:iojf8e$1gs$1@fred.mathworks.com...
> > Hi all
> >
> > I am also trying to run a matlab file on the linux command line and have
> > encountered the same problems. The line I enter on the command line is:
> >
> > nohup matlab -nojvm -r "My_script" > My_script_out.txt&
> >
> > I have placed the exit command at the end of the file 'My_script' but
> > Matlab seems to go into a never ending loop and prints 'bad file
> > descriptor' in the output file when it finishes executing the matlab
> > script. Has anyone encountered this problem and if so, what is the
> > solution?
>
> I'm not certain -- you should contact Technical Support for help determining
> the cause of this behavior.
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

Subject: How to run matlab in background on a linux server?

From: isabel

Date: 3 May, 2012 22:01:08

Message: 4 of 4

"Yuheng" wrote in message <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

you missed the < to pass the input argument (file name)
nohup matlab < linux_try.m 1> std.out 2> err.out &

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us