comparison scripts/statistics/base/cov.m @ 3456:434790acb067

[project @ 2000-01-19 06:58:51 by jwe]
author jwe
date Wed, 19 Jan 2000 06:59:23 +0000
parents f8dde1807dee
children d25bc039237b
comparison
equal deleted inserted replaced
3455:f758be6e1730 3456:434790acb067
21 ## @code{cov (@var{x}, @var{y})} is the covariance between the @var{i}-th 21 ## @code{cov (@var{x}, @var{y})} is the covariance between the @var{i}-th
22 ## variable in @var{x} and the @var{j}-th variable in @var{y}. If called 22 ## variable in @var{x} and the @var{j}-th variable in @var{y}. If called
23 ## with one argument, compute @code{cov (@var{x}, @var{x})}. 23 ## with one argument, compute @code{cov (@var{x}, @var{x})}.
24 ## @end deftypefn 24 ## @end deftypefn
25 25
26 ## Author: KH <Kurt.Hornik@ci.tuwien.ac.at> 26 ## Author: KH <Kurt.Hornik@ci.tuwien.ac.at>
27 ## Description: Compute covariances 27 ## Description: Compute covariances
28 28
29 function c = cov (x, y) 29 function c = cov (x, y)
30 30
31 if (nargin < 1 || nargin > 2) 31 if (nargin < 1 || nargin > 2)
32 usage ("cov (x [, y])"); 32 usage ("cov (x, y)");
33 endif 33 endif
34 34
35 if (rows (x) == 1) 35 if (rows (x) == 1)
36 x = x'; 36 x = x';
37 endif 37 endif