How do I pass arguments into and out of my standalone executable?
286 views (last 30 days)
More Answers (4)
Antti on 26 Jan 2018
Note that in R2017b (and possibly beyond) on Windows 10, no output is printed on the Windows command prompt unless you uncheck "Do not display the Windows command shell (console) for execution" under "Additional runtime settings" in the Application Compiler tool of MATLAB Compiler.
Iaroslav Linder on 5 Nov 2018
Edited: Iaroslav Linder on 5 Nov 2018
Finally found a solution how to input and output variables in generated executables. Here is the example (Name the script main.m)
num=0; %this converts to double
coder.ceval('scanf','%lf',coder.ref(num)); % not '%f'
fprintf(1,'The squared value is %f\n',sqrt(double(num)));
Steve Lim on 13 Dec 2016
The examples show how to specify the input parameters to launch an application (exe). Within the application, what's the MATLAB source code look like to get the input parameter strings?
Ewen Chan on 17 May 2018
Sorry for resurrecting a super old thread, but I have a question about this:
So in the script that I have now, at the start of it, I have declared some variables and assigned them values.
c0 = 3;
c1 = 100;
c2 = 500;
pi = 0.1;
p = 0.05;
N = 650;
e1 = 0.001;
e2 = 0.001;
If I want to create a standalone application, so that I can vary the numbers for those variables, how would I go about doing that?
Do I use the Application Compiler?
And if so, how do I go about doing that? This is my first attempt at a) trying to compile a standalone application and b) trying to pass input arguments that will change the variables that is currently at the top of my script/code.
Any help would be greatly appreciated.