It is possible to call a synchronous method asynchronously in MATLAB®. With some modifications, you can use the Microsoft®
EndInvoke methods. For more
information, refer to the MSDN® article Calling Synchronous Methods Asynchronously.
You can use delegates to call a synchronous method asynchronously by using the
EndInvoke methods. If
the thread that initiates the asynchronous call does not need to be the thread that
processes the results, you can execute a callback method when the call
MATLAB is a single-threaded application. Therefore, handling asynchronous calls in the MATLAB environment might result in deadlocks.
The MATLAB delegate signature for
EndInvoke follows special
mapping rules if your delegate has
type arguments. For information about the mapping, see .NET Delegates With out and ref Type Arguments. For examples, see the
EndInvoke reference page.
For MATLAB to process the event that executes the delegate callback on the main
thread, call the MATLAB
pause (or a similar) function.