Matlab Compiler: passing parameters

16 次查看(过去 30 天)
The use of Matlab Compiler:
  1. How can I prepare a compiled Standalone Application such that the user can open it either in a Matlab command window or a web browser?
  2. How can I prepare the compiled app such that the user can pass the input arguments of the Matlab function and receive the output arguments?

采纳的回答

Steven Lord
Steven Lord 2024-10-18
How can I prepare a compiled Standalone Application such that the user can open it either in a Matlab command window or a web browser?
Running a compiled app by typing the name of the executable in the MATLAB Command Prompt is not supported (though you could call it using the system function.) For this use case I'd consider providing the non-compiled MATLAB program files (your scripts, functions, and/or classes) to users who need to run this in MATLAB.
As for web apps, see this section of the documentation.
How can I prepare the compiled app such that the user can pass the input arguments of the Matlab function and receive the output arguments?
See this documentation page. Input arguments should work (with the caveat that they are received by the application as char vectors by default, as noted on that page.) Where would you expect to receive any output arguments to if that were supported and you were (for example) running your application as a web app? That page talks about other ways to get information out of your application.
  2 个评论
Magdy Hanna
Magdy Hanna 2024-10-25,8:59
Passing input parameters to a standalone compiled function
How can I pass a numeric matrix as an input argument to a standalone compiled function?
Example:
The name of the function: test_SP6
The running command: test_SP6 13 "[5 7]"
It seems that the system does not recognize matrix B correctly.
Attachments:
  1. The M-file of the function
  2. A screen shot showing the running of the standalone compiled function in the command prompt.
Steven Lord
Steven Lord 2024-10-25,13:13
This is directly covered in the "Handle Input Arguments in MATLAB" section on the last of the documentation pages to which I linked. The application receives the inputs as text and you will need to convert that text into a numeric matrix.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Web App Server 的更多信息

产品


版本

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by