view examples/code/@polynomial/plot.m @ 33661:4c378dd47cf2 default tip @

command-widget: Use new signal-slot syntax for better compiler diagnostics. * libgui/src/command-widget.cc (console::console): Use new signal-slot syntax for better compiler diagnostics.
author Markus Mützel <markus.muetzel@gmx.de>
date Wed, 12 Jun 2024 17:24:20 +0200
parents 9b3149cd486b
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, polyval (p, x), varargin{:});
  else
    plot (x, polyval (p, x), varargin{:});
  endif

endfunction