view examples/@polynomial/get.m @ 17422:20d1b911b4e7 classdef

* libinterp/corefcn/load-path.cc (genpath): Ignore package dirs.
author Michael Goffioul <michael.goffioul@gmail.com>
date Thu, 12 Sep 2013 21:08:07 -0400
parents 567e3e4ab74d
children
line wrap: on
line source

function s = get (p, f)
  if (nargin == 1)
    s.poly = p.poly;
  elseif (nargin == 2)
    if (ischar (f))
      switch (f)
        case "poly"
          s = p.poly;
        otherwise
          error ("get: invalid property %s", f);
      endswitch
    else
      error ("get: expecting the property to be a string");
    endif
  else
    print_usage ();
  endif
endfunction