help-octave
[Top][All Lists]
Advanced

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

Re: I have modified firls.m to include all types of FIRs plus HT and dif


From: Nicholas Jankowski
Subject: Re: I have modified firls.m to include all types of FIRs plus HT and diff
Date: Thu, 18 May 2017 07:51:36 -0400

On May 18, 2017 7:23 AM, "Nicholas Jankowski" <address@hidden> wrote:


On May 17, 2017 12:18 PM, "je suis" <address@hidden> wrote:



<snip>

looking at the code, you're first line

function h = firls(N, F, A, K, ftype)

Should be:

function h = firls(N, F, A, varargin)

That will let it accept any number of arguments after A, and store them in a cell array named varargin.  Then, a code block based in the number and type of varagin elements can determine how to run your code

 Something with the form below might work:

switch numel(nargin)

case 3
<set defaults>

case 4
<Check if #4 is a weight vector or a string, set values, like K = varargin{1}, and defaults for the rest>

case 5
<verify the order is right, assign K= varargin{1}, ftype= varargin{2}>

otherwise
  print_usage()

Then, check that K is valid, ftype matches, set vectors to columns or rows, etc.



reply via email to

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