matlab.engine.FutureResult.result - Result of asynchronous call to MATLAB function from Python - MATLAB (original) (raw)

Main Content

Class: matlab.engine.FutureResult
Namespace: matlab.engine

Result of asynchronous call to MATLAB function from Python

Syntax

ret = FutureResult.result(timeout=None)

Description

[ret](#bukhpnf-ret) = FutureResult.result([timeout](#bukhpnf-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 MATLABsqrt function from Python. Set background to True and get the square root from the FutureResult object.

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