Main Content

matlab.engine.FutureResult Class

Namespace: matlab.engine

Results of asynchronous call to MATLAB function stored in Python object

Description

The FutureResult class stores results of an asynchronous call to a MATLAB® function in a Python® object.

Creation

The MATLAB Engine for Python creates a FutureResult object when a MATLAB function is called asynchronously. There is no need to call matlab.engine.FutureResult() to create FutureResult objects of your own.

Methods

expand all

Exceptions

SyntaxError

Python exception, syntax error in function call

TypeError

Python exception, data type of output argument not supported

matlab.engine.CancelledError

MATLAB engine cannot cancel function call

matlab.engine.InterruptedError

Function call interrupted

matlab.engine.MatlabExecutionError

Function call fails to execute

matlab.engine.RejectedExecutionError

Engine terminated

matlab.engine.TimeoutError

Result cannot be returned within the timeout period

Examples

collapse all

Call the MATLAB sqrt function from Python. Set background to True to make the function call asynchronously.

import matlab.engine
eng = matlab.engine.start_matlab()
future = eng.sqrt(4.0,background=True)
ret = future.result()
print(ret)
2.0

Version History

Introduced in R2014b