Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

matlab.engine.FutureResult class

Package: 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.

Construction

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

cancelCancel asynchronous call to MATLAB function from Python
cancelledCancellation status of asynchronous call to MATLAB function from Python
doneCompletion status of asynchronous call to MATLAB function from Python
resultResult of asynchronous call to MATLAB function from Python

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

expand all

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

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

Introduced in R2014b

Was this topic helpful?