Mercurial > hg > octave-lyh
view examples/@polynomial/plot.m @ 11220:883b9308353c
allow class function to be called from methods as well as constructors
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 10 Nov 2010 00:54:34 -0500 |
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