Main Content

result

Class: matlab.engine.FutureResult
Package: matlab.engine

Result of asynchronous call to MATLAB function from Python

Syntax

ret = FutureResult.result(timeout=None)

Description

ret = FutureResult.result(timeout=None) returns the actual result of a call to a MATLAB® function called asynchronously from Python®.

Input Arguments

expand all

Timeout value in seconds, specified as Python data type float, to wait for result of the function call. If timeout = None, the FutureResult.result function waits until the function call finishes, and then returns the result.

Output Arguments

expand all

Result of an asynchronous function call, returned as a Python object, that is the actual output argument of a call to a MATLAB function.

Examples

expand all

Call the MATLAB sqrt function from Python. Set async to True and get the square root from the FutureResult object.

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