view examples/@polynomial/get.m @ 15175:5984aa619cd9

doc: Remove multiple seealso links to I (bug #37046). arith.txi: Remove multiple doc-anchors to I data.cc: Remove multiple seealso links (i,j,J) to I.
author Rik <rik@octave.org>
date Tue, 14 Aug 2012 21:32:26 -0700
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