使用 REST 调用 MATLAB 函数
R2026b创建允许客户端应用程序调用 MATLAB® 函数的 REST 函数服务
您可以创建 MATLAB REST 函数服务以允许客户端应用程序通过 HTTPS 协议调用用户定义的 MATLAB 函数。无论您的平台和执行环境如何,该服务都支持您的程序与 MATLAB 之间的通信。您可以使用任何能够本地或远程调用 REST 的编程语言或应用程序来调用自定义 MATLAB 函数。
只有您可以执行 MATLAB 实例中的函数。
对象
RESTFunctionService | Service for calling MATLAB functions from client applications (自 R2024a 起) |
ClientRequestInfo | Client to function service HTTPS request information (自 R2024a 起) |
RESTFunctionConnector | MATLAB to client application connection (自 R2024a 起) |
函数
restFunctionServices | List of function services in current MATLAB session (自 R2024a 起) |
Python 客户端类
matlab.rest_function_service.client.MWHttpClient | Python client interface for calling MATLAB REST function service |
MATLAB 函数执行的 REST 服务参考
POST Synchronous
Request | Make synchronous request to MATLAB REST function service and wait for response |
主题
- Create MATLAB REST Function Services
Enable licensed MATLAB users to make RESTful function calls to their MATLAB instance.
- Call MATLAB Functions from External Languages Using REST
Call user-defined MATLAB functions from Java®, C++, and other external language clients using the synchronous request-response model.
- Call MATLAB Functions from Python Using REST
Call user-defined MATLAB functions from Python® clients using native Python data types and the synchronous request-response model. (自 R2026b 起)
- JSON Representation of MATLAB Data Types
Represent supported MATLAB data types in JSON.
- Data Type Conversions Between MATLAB REST Function Services and Python
Learn how the MATLAB REST function service converts data types passed between Python and MATLAB.