help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

xcov.m and center.m functions in matcompat suite


From: E. Joshua Rigler
Subject: xcov.m and center.m functions in matcompat suite
Date: Sun, 29 Apr 2001 18:23:05 -0600

I think this is an issue with the matcompat libraries...

There is a bug in xcov.m.  It calculates a [auto|cross]covariance by
taking the [auto|cross]correlation of the given time series  minus its
mean.  After a bunch of "nargin" processing to determine exactly what
parameters have been passed, the following line is supposed to do the
job:

  [retval, lags] = xcorr(center(X), center(Y), maxlag, scale);

The problem is that if you attempt an auto-covariance, the xcov.m
function sets Y to a null array.  xcorr.m can handle this fine, but
center.m cannot.  It chokes by saying it expects a vector or a matrix.

It's an easy fix, I'll just slightly modify my copy of xcov.m to call
xcorr.m without a Y argument if I want an auto-covariance.  I'm just
wondering if this is the best solution, or should center.m be modified
to accept a null argument?

-EJR

-- 
E. Joshua Rigler
Laboratory for Atmospheric and Space Physics (LASP)
University of Colorado -  CB 590
Boulder, CO 80309  (303)492-5826
address@hidden



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]