How do I parse input options from the a DOS command line?
이전 댓글 표시
Hi,
I have a M file function (see snippet below) that can take in several options. It works fine in MatLab. However, when I compile it a run it from a DOS command line, the options do not parse correctly. Questions:
First, what is the correct DOS commnad line input look like?
Example: imageComp " 'scale', .5 "
Second, if all command line arguments are passed in as strings, will the parser be able to differentiate between '.5' the string and .5 the float?
Thanks for the help,
Jerry
=============================================================
function imageComp(varargin)
inParser = inputParser; % Create an instance of the class.
inParser.addParamValue('scale', .5, @isfloat);
inParser.parse(varargin{:});
% Do other stuff......
end
댓글 수: 2
Image Analyst
2013년 4월 17일
What does "I compile it a run it from...." mean? Are you trying to compile an m-file from a DOS command line into a standalone executable, or are you running an already-compiled standalone executable from the DOS command line?
Jerry Muir
2013년 5월 15일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Argument Definitions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!