Chebwin

Søren Hauberg soren at hauberg.org
Mon Jul 27 15:02:38 CDT 2009


man, 27 07 2009 kl. 20:57 +0200, skrev Børge Strand-Bergesen:
> chebwin(5,17) works fine while chebwin(5,18) returns NaN. I'm using
> chebwin(355,150) in Matlab with no problem.

The problem seemed to be in 'cheb'. I applied the following patch

        Index: cheb.m
        ===================================================================
        --- cheb.m	(revision 6022)
        +++ cheb.m	(working copy)
        @@ -42,13 +42,12 @@
           endif
         				# avoid resizing latencies
           T = zeros(size(x));
        -  
        -  ind = x<=1;
        +  ind = abs (x) <= 1;
           if (max(size(ind)))
             T(ind) = cos(n*acos(x(ind)));
           endif
         
        -  ind = x>1;
        +  ind = abs (x) > 1;
           if (max(size(ind)))
             T(ind) = cosh(n*acosh(x(ind)));
           endif

Søren



More information about the Bug-octave mailing list