view examples/@polynomial/get.m @ 18479:85d31344fb23 stable rc-3-8-1-2

3.8.1 release candidate 2 * configure.ac (OCTAVE_VERSION): Bump to 3.8.1-rc2. (OCTAVE_MINOR_VERSION): Bump to 1-rc2. (OCTAVE_RELEASE_DATE): Set to 2014-02-14.
author John W. Eaton <jwe@octave.org>
date Mon, 17 Feb 2014 02:20:39 -0500
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