Start Function, but not wait for it to complete

  • Follow


I am new to matlab, so bear with me.  I want to kick-off matlab for within a matlab function, but I don't want to want for the code to complete before I contiune in my function.  How can you do that?  Here is a rough example on what I am trying to do:

%Kick off do_math1 and do_math2 on the data in parallel...we will look for completion later
function do_math (data)
    %Kick off do_math1, but don't wait for it to complete to continue
    do_math1(data)

    %Kick off do_math2, but don't wait for it to complete to continue
    do_math2(data)
0
Reply Dave 3/4/2010 2:04:21 PM

"Dave " <moze_man@yahoo.com> wrote in message 
news:hmoel5$8me$1@fred.mathworks.com...
>I am new to matlab, so bear with me.  I want to kick-off matlab for within 
>a matlab function, but I don't want to want for the code to complete before 
>I contiune in my function.  How can you do that?  Here is a rough example 
>on what I am trying to do:
>
> %Kick off do_math1 and do_math2 on the data in parallel...we will look for 
> completion later
> function do_math (data)
>    %Kick off do_math1, but don't wait for it to complete to continue
>    do_math1(data)
>
>    %Kick off do_math2, but don't wait for it to complete to continue
>    do_math2(data)

To do what you described, you will need Parallel Computing Toolbox (or to 
launch a separate MATLAB session in which to run each function.)

-- 
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ 


0
Reply Steven 3/4/2010 2:18:59 PM


We do have Parallel Computing Toolbox.  Is there a to transform the code above to work with the Parallel Computing Toolbox?
0
Reply Dave 3/4/2010 2:42:02 PM

2 Replies
397 Views

(page loaded in 0.023 seconds)

Similiar Articles:













7/24/2012 9:25:02 AM


Reply: