view examples/@polynomial/get.m @ 8834:8dd69187c4a2

specialize sqrt for diagonal matrices
author Jaroslav Hajek <highegg@gmail.com>
date Fri, 20 Feb 2009 21:49:26 +0100
parents dba0037e6602
children 567e3e4ab74d
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