result
类: matlab.engine.FutureResult
命名空间: matlab.engine
从 Python 异步调用 MATLAB 函数的结果
语法
ret = FutureResult.result(timeout=None)
输入参数
timeout
— 以秒为单位的超时值
None
(默认) | Python float
等待函数调用结果的超时值(以秒为单位),指定为 Python 数据类型 float
。如果 timeout = None
,FutureResult.result
函数会一直等到函数调用结束,然后才返回结果。
输出参量
ret
— 异步函数调用的结果
Python 对象
异步函数调用的结果,以 Python 对象形式返回,这是调用 MATLAB 函数的实际输出参量。
示例
从异步调用中获取 MATLAB 输出参量
从 Python 调用 MATLAB sqrt
函数。将 background
设置为 True
,并从 FutureResult
对象中获取平方根。
import matlab.engine eng = matlab.engine.start_matlab() future = eng.sqrt(4.0,background=True) ret = future.result() print(ret)
2.0
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)