view examples/@polynomial/plot.m @ 9636:74be4b7273e4 ss-3-3-50

update version info for snapshot
author John W. Eaton <jwe@octave.org>
date Sat, 12 Sep 2009 06:55:13 -0400
parents dba0037e6602
children 1b48b209a8d6
line wrap: on
line source

function h = plot(p, varargin)
  n = 128;
  rmax = max (abs (roots (p.poly)));
  x = [0 : (n - 1)] / (n - 1) * 2.2 * rmax - 1.1 * rmax;
  if (nargout > 0)
    h = plot(x, p(x), varargin{:});
  else
    plot(x, p(x), varargin{:});
  endif
endfunction