view examples/code/@FIRfilter/subsref.m @ 20412:b7ee5cefa9d6 stable

Update make_int example to current octave_base_value API (bug #45136) * make_int.cc (octave_integer::print): Make non-const. Add a newline for consistency with core library conventions.
author Mike Miller <mtmiller@octave.org>
date Mon, 18 May 2015 19:14:41 -0400
parents c8240a60dd01
children
line wrap: on
line source

function out = subsref (f, x)
  switch (x.type)
    case "()"
      n = f.polynomial;
      out = filter (n.poly, 1, x.subs{1});
    case "."
      fld = x.subs;
      if (strcmp (fld, "polynomial"))
        out = f.polynomial;
      else
        error ("@FIRfilter/subsref: invalid property \"%s\"", fld);
      endif
    otherwise
      error ("@FIRfilter/subsref: invalid subscript type for FIR filter");
  endswitch
endfunction