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!