diff scripts/polynomial/polyval.m @ 12481:97d103fcb6dd

polynomial/polyval.m: Minor simplification in polynomial evaluation
author Ben Abbott <bpabbott@mac.com>
date Sat, 26 Feb 2011 16:07:52 -0500
parents 009068efc66d
children 3244c6e0af4a
line wrap: on
line diff
--- a/scripts/polynomial/polyval.m
+++ b/scripts/polynomial/polyval.m
@@ -69,11 +69,10 @@
 
   n = length (p) - 1;
   x = (x - mu(1)) / mu(2);
-  y = p(1) * ones (size (x(:)));
+  y = p(1) * ones (size (x));
   for i = 2:n+1
-    y = y .* x(:) + p(i);
+    y = y .* x + p(i);
   endfor
-  y = reshape (y, size (x));
 
   if (nargout == 2)
     ## Note: the F-Distribution is generally considered to be single-sided.