필터 지우기
필터 지우기

input parameters of standalone application

조회 수: 1 (최근 30일)
Marzi
Marzi 2015년 11월 9일
답변: Walter Roberson 2015년 11월 10일
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?

답변 (1개)

Walter Roberson
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.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by