comparison 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
comparison
equal deleted inserted replaced
12480:139f993936af 12481:97d103fcb6dd
67 return; 67 return;
68 endif 68 endif
69 69
70 n = length (p) - 1; 70 n = length (p) - 1;
71 x = (x - mu(1)) / mu(2); 71 x = (x - mu(1)) / mu(2);
72 y = p(1) * ones (size (x(:))); 72 y = p(1) * ones (size (x));
73 for i = 2:n+1 73 for i = 2:n+1
74 y = y .* x(:) + p(i); 74 y = y .* x + p(i);
75 endfor 75 endfor
76 y = reshape (y, size (x));
77 76
78 if (nargout == 2) 77 if (nargout == 2)
79 ## Note: the F-Distribution is generally considered to be single-sided. 78 ## Note: the F-Distribution is generally considered to be single-sided.
80 ## http://www.itl.nist.gov/div898/handbook/eda/section3/eda3673.htm 79 ## http://www.itl.nist.gov/div898/handbook/eda/section3/eda3673.htm
81 ## t = finv (1-alpha, s.df, s.df); 80 ## t = finv (1-alpha, s.df, s.df);