MATLAB: Compile MatLab into standalone exe, how to pass matrices as input.

compilerexepass matrices as input

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!

Best Answer

"[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.