compile MatLab into standalone exe, how to pass matrices as input.
조회 수: 7 (최근 30일)
이전 댓글 표시
Hi,
I compiled my MatLab model into a standalone exe, I am looking for ways to pass matrices as input. According to the compiler documentation -> passing arguments to and from a standalone application, it mentioned that argument from command line is considered as string input, therefore we need to adjust MatLab model to be aware of that. It also showed example to convert string to double. But how about matrices/vectors? If my function accepts input as matrices, how do I pass it from command line? Thanks!
댓글 수: 0
채택된 답변
dpb
2019년 1월 9일
"[A]rguments can be passed to standalone applications created using MATLAB® Compiler™ in the same way that input arguments are passed to any console-based application"
This means the application doesn't get an array but the string representation of the array and there's no connection to command line arguments to ML variables excepting by writing code to parse those arguments and place the result in the proper variable.
Sad, but true; when an app is compiled, it becomes just like any other console application; all the interaction with Matlab and the command window and variables known in Matlab when the compiled app is dispatched are simply not there between the two any longer...all the app has access to is the text on the command line to retrieve and do with what it will.
For anything but the most trivial of inputs, it's probably better to use a file for the purpose.
댓글 수: 3
dpb
2019년 1월 9일
편집: dpb
2019년 1월 10일
I dunno much about the DLL interface route, sorry.
If you were to write a .mex function, it could be called like any other Matlab function and be passed any of the base ML datatypes -- I've not checked recently whether the API has been extended to a bunch of the more recent and exotic new datatypes/classes or not, but certainly arrays of double and the like...
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Deploy to C++ Applications Using mwArray API (C++03)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!