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!