changeset 21067:9b3149cd486b

Fix incorrect example code for @polynomial/plot.m (bug #46892). * examples/code/@polynomial/plot.m: Use polyval method to evaluate polynomial rather than operator overloading of indexing which won't work in class method.
author Rik <rik@octave.org>
date Thu, 14 Jan 2016 08:15:40 -0800
parents 258c787cd9ce
children c221ce56f774
files examples/code/@polynomial/plot.m
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/examples/code/@polynomial/plot.m	Thu Jan 14 07:02:41 2016 -0800
+++ b/examples/code/@polynomial/plot.m	Thu Jan 14 08:15:40 2016 -0800
@@ -4,9 +4,9 @@
   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{:});
+    h = plot (x, polyval (p, x), varargin{:});
   else
-    plot (x, p(x), varargin{:});
+    plot (x, polyval (p, x), varargin{:});
   endif
 
 endfunction