view examples/@polynomial/plot.m @ 17500:be7e8b91c6b1

hist.m: Overhaul function. * scripts/plot/hist.m: Rephrase some of docstring. Put input validation first. Use variable names in error messages. Use meaningful variable name 'xsort' rather than 'tmp'. Use in-place operators for performance.
author Rik <rik@octave.org>
date Wed, 25 Sep 2013 11:34:53 -0700
parents 1b48b209a8d6
children
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