From bug-octave-request at bevo dot che dot wisc dot edu Tue Nov 12 14:53:08 2002 Subject: bug in signal processing function bartlett From: "John W. Eaton" To: mark dot esplin at sdl dot usu dot edu Cc: bug-octave at bevo dot che dot wisc dot edu Date: Tue, 12 Nov 2002 14:52:53 -0600 On 15-Nov-2001, Mark Esplin wrote: | I sent a copy of this bug report to the help-octave list. Then I realized I | should have sent it to the bug-octave list. Sorry for sending it twice. | | -Mark Esplin | |   I am using GNU Octave, version 2.1.34 (i686-pc-linux-gnu).  When I try to | make a Bartlett window I get the following results: | | octave:1> bartlett(10) | error: A(I) = X: X must be a scalar or a matrix with the same size as I | error: evaluating assignment expression near line 44, column 17 | error: evaluating if command near line 39, column 3 | error: called from `bartlett' in file | `/usr/local/share/octave/2.1.34/m/signal/bartlett.m' | | Removing the transpose from lines 44 and 45 of bartlett.m fixes the problem.   | That is change lines 44 and 45 of octave/2.1.34/m/signal/bartlett.m | from: | |     c (1 : n+1) = 2 * (0 : n)' / m; |     c (n+2 : m+1) = 2 - 2 * (n+1 : m)'/m; | | to: | |     c (1 : n+1) = 2 * (0 : n) / m; |     c (n+2 : m+1) = 2 - 2 * (n+1 : m)/m; Sorry for the long delay in responding. I made the following change instead. Thanks, jwe *** bartlett.m.~1.6.~ Fri Aug 9 13:52:42 2002 --- bartlett.m Tue Nov 12 14:50:56 2002 *************** *** 44,53 **** else m = m - 1; n = fix (m / 2); ! c (1 : n+1) = 2 * (0 : n)' / m; ! c (n+2 : m+1) = 2 - 2 * (n+1 : m)'/m; endif - c = c'; - endfunction --- 44,50 ---- else m = m - 1; n = fix (m / 2); ! c = [2*(0:n)/m, 2-2*(n+1:m)/m]'; endif endfunction ------------------------------------------------------------- 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 -------------------------------------------------------------