[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #60432] xcorr documentaion misleading or error
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #60432] xcorr documentaion misleading or error in code |
Date: |
Wed, 21 Apr 2021 12:08:02 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0 |
URL:
<https://savannah.gnu.org/bugs/?60432>
Summary: xcorr documentaion misleading or error in code
Project: GNU Octave
Submitted by: None
Submitted on: Wed 21 Apr 2021 04:08:00 PM UTC
Category: Octave Forge Package
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Unexpected Error or Warning
Status: None
Assigned to: None
Originator Name: IK Proudler
Originator Email: ikp1@f2s.com
Open/Closed: Open
Release: 5.2.0
Discussion Lock: Any
Operating System: GNU/Linux
_______________________________________________________
Details:
The documentation for xcorr is misleading or there is a logical error in the
code.
'help xcorr' says:
-- Function File: [R, LAG] = xcorr ( X )
-- Function File: ... = xcorr ( X, Y )
-- Function File: ... = xcorr ( ..., MAXLAG)
-- Function File: ... = xcorr ( ..., SCALE)
Thus, with M a matrix and Nlag an integer, the call
xcorr(M,Nlag,'coeff')
should work. However it returns an error:
error: xcorr: X must be a vector or matrix
error: called from
xcorr at line 171 column 5
The relevant lines are:
169 ## check argument values
170 if isempty(X) || isscalar(X) || ischar(Y) || ! ismatrix(X)
171 error("xcorr: X must be a vector or matrix");
For my call to work, I think the boolean
ischar(Y) || ! ismatrix(X)
should be replaced with
ischar(Y) && ! ismatrix(X)
Alternatively, since the call
xcorr(M,Nlag,'coeff')
works, the help message needs to be changed so that MAXLAG comes before
SCALE.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60432>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #60432] xcorr documentaion misleading or error in code,
anonymous <=