octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Package Contribution Procedure and Best Way to Interpret Name, Value


From: Juan Pablo Carbajal
Subject: Re: Package Contribution Procedure and Best Way to Interpret Name, Value Arguments?
Date: Sun, 1 Jan 2017 12:09:09 +0100

On Sat, Dec 31, 2016 at 5:43 PM, PhilipNienhuis <address@hidden> wrote:
>> Question 2)
>> Now that statelevels exists, I can write dutycycle. This function will
>> have
>> a few *Name,Value* variable arguments. Is there a standard way to
>> interpret
>> these?
>
> There's the inputparser class in core Octave. I've never used it but I think
> it can do the job.

It depends on the maximum number of expected arguments. If you plan to
have a lot of configurable options, then I strongly suggest
InputParser to keep the code clean (it also handles default values and
input validation). If you are thinking of just a few options (one,
two?) then do the switch or if block.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]