input parameters of standalone application
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have an standalone application (.exe file) and uses MCR to be executed. When I run the exe file, a window pops up and ask the input parameters (filename, some other parameters). I want to run it on lots of files so I need to run it in a batch. However, I do not know how to pass the parameters to it in a commandline (without pops up window). Is there any way to do it?
0 commentaires
Réponses (1)
Walter Roberson
le 10 Nov 2015
The difficulty of doing that is going to depend upon the way it is coded to do the prompting, which you have not specified.
In the general case you might have to use something like the Java Robot Class to simulate key presses and button clicks on top of the forms that your program pops up. But if you have control over the source of the program then you would generally instead modify the code a little to get it to understand command line parameters.
When you invoke a compiled executable, then anything you type on the command line is passed a string parameters to the main function, the one which you instructed MATLAB to compile. You can use nargin and varargin to examine the arguments. Keep in mind that they will all be strings, so if any of them are to be interpreted as numbers, str2double() the corresponding value.
0 commentaires
Voir également
Catégories
En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!