Mercurial > hg > octave-terminal
changeset 8980:80d499b82ff3
fix typos in var.m
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sat, 14 Mar 2009 10:38:43 +0100 |
parents | a7c00773a089 |
children | ed5055b0a476 |
files | scripts/ChangeLog scripts/statistics/base/var.m |
diffstat | 2 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2009-03-14 Jaroslav Hajek <highegg@gmail.com> + + * statistics/base/var.m: a -> x. + 2009-03-13 Jaroslav Hajek <highegg@gmail.com> * statistics/base/mean.m: Simplify.
--- a/scripts/statistics/base/var.m +++ b/scripts/statistics/base/var.m @@ -41,7 +41,7 @@ ## Author: KH <Kurt.Hornik@wu-wien.ac.at> ## Description: Compute variance -function y = var (x, opt, dim) +function retval = var (x, opt, dim) if (nargin < 1 || nargin > 3) print_usage (); @@ -56,11 +56,11 @@ opt = 0; endif - n = size (a, dim); + n = size (x, dim); if (n == 1) retval = zeros (sz); - elseif (numel (a) > 0) - retval = sumsq (center (a, dim), dim) / (n + opt - 1); + elseif (numel (x) > 0) + retval = sumsq (center (x, dim), dim) / (n + opt - 1); else error ("var: x must not be empty"); endif