MATLAB 帮助中心
类: matlab.engine.FutureResult 命名空间: matlab.engine
从 Python 异步调用 MATLAB 函数的结果
ret = FutureResult.result(timeout=None)
ret = FutureResult.result(timeout=None) 返回从 Python® 异步调用 MATLAB® 函数的实际调用结果。
ret
timeout
全部展开
None
float
等待函数调用结果的超时值(以秒为单位),指定为 Python 数据类型 float。如果 timeout = None,FutureResult.result 函数会一直等到函数调用结束,然后才返回结果。
timeout = None
FutureResult.result
异步函数调用的结果,以 Python 对象形式返回,这是调用 MATLAB 函数的实际输出参量。
从 Python 调用 MATLAB sqrt 函数。将 background 设置为 True,并从 FutureResult 对象中获取平方根。
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
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处