Home > freetb4matlab > statistics > base > cor.m

cor

PURPOSE ^

% Compute correlation.

SYNOPSIS ^

function retval = cor (x, y)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {} cor (@var{x}, @var{y})
% Compute correlation.
%
% The (@var{i}, @var{j})-th entry of @code{cor (@var{x}, @var{y})} is
% the correlation between the @var{i}-th variable in @var{x} and the
% @var{j}-th variable in @var{y}.
%
% @tex
% $$
% {\rm corrcoef}(x,y) = {{\rm cov}(x,y) \over {\rm std}(x) {\rm std}(y)}
% $$
% @end tex
% @ifnottex
% @example
% corrcoef(x,y) = cov(x,y)/(std(x)*std(y))
% @end example
% @end ifnottex
%
% For matrices, each row is an observation and each column a variable;
% vectors are always observations and may be row or column vectors.
%
% @code{cor (@var{x})} is equivalent to @code{cor (@var{x}, @var{x})}.
%
% Note that the @code{corrcoef} function does the same as @code{cor}.
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003