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

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?
I meant to say that I compiled it and then ran the resulting exe in a DOS window.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Argument Definitions에 대해 자세히 알아보기

질문:

2013년 4월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by