How do I parse input options from the a DOS command line?
Mostra commenti meno recenti
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 Commenti
Image Analyst
il 17 Apr 2013
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
il 15 Mag 2013
Risposte (0)
Categorie
Scopri di più su Argument Definitions in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!