Running a script/Invoking a function "in the background"

  • Follow


Hi,

I'm using Matlab v7.10.0.499 (R2010a) for Windows. I want to know if there is any way that, once you have started matlab, run a script or call a function "in the background"using some kind of operator (e.g., like & in unix). For instance:

>> my_script &

% my_script is still executing

>> my_other_script &

% my_script AND my_other_script are executing

>> % I can type other commands here

I'm not asking how to start an instance of Matlab in the command line (e.g., with nodesktop) in a non-interactive way. I know I can invoke Matlab and ask it to execute a script passed as a command line argument, but that's not what I'm asking.

Thanks
0
Reply Mark 1/26/2011 9:04:03 PM

No way of doing this?

"Mark" wrote in message <ihq283$qhn$1@fred.mathworks.com>...
> Hi,
> 
> I'm using Matlab v7.10.0.499 (R2010a) for Windows. I want to know if there is any way that, once you have started matlab, run a script or call a function "in the background"using some kind of operator (e.g., like & in unix). For instance:
> 
> >> my_script &
> 
> % my_script is still executing
> 
> >> my_other_script &
> 
> % my_script AND my_other_script are executing
> 
> >> % I can type other commands here
> 
> I'm not asking how to start an instance of Matlab in the command line (e.g., with nodesktop) in a non-interactive way. I know I can invoke Matlab and ask it to execute a script passed as a command line argument, but that's not what I'm asking.
> 
> Thanks
0
Reply Mark 1/28/2011 4:03:03 PM


On 26/01/11 3:04 PM, Mark wrote:

> I'm using Matlab v7.10.0.499 (R2010a) for Windows. I want to know if
> there is any way that, once you have started matlab, run a script or
> call a function "in the background"using some kind of operator (e.g.,
> like & in unix). For instance:
>
>>> my_script &
>
> % my_script is still executing
>
>>> my_other_script &
>
> % my_script AND my_other_script are executing


There is no mechanism for this. The closest I can think of that could be 
achieved is some "cooperative multitasking", in which each background 
routine had been written in such a way that it progressed a little and 
then deliberately gave up control, continuing on the next time it was 
granted control. For more complicated routines, that would probably 
require that the routines be written as "state machines".
0
Reply Think 1/28/2011 5:02:07 PM

2 Replies
474 Views

(page loaded in 0.079 seconds)

Similiar Articles:













7/21/2012 5:43:38 PM


Reply: