input parameters of standalone application
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Walter Roberson
2015-11-10
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!