octave-maintainers
[Top][All Lists]
Advanced

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

Re: Patch to hist for changes in bar


From: David Bateman
Subject: Re: Patch to hist for changes in bar
Date: Thu, 26 Apr 2007 18:35:29 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

John W. Eaton wrote:
>   ***** assert(hist(1,1),1);
> !!!!! test failed
> error: invalid vector index = 0
>   ***** test
>   for n = [10, 30, 100, 1000]
>     assert( sum(hist([1:n], n)), n );
>     assert( sum(hist([1:n], [2:n-1])), n);
>     assert( sum(hist([1:n], [1:n])), n );
>     assert( sum(hist([1:n], 29)), n);
>     assert( sum(hist([1:n], 30)), n);
>   endfor
> !!!!! test failed
> error: assert (sum (hist ([1:n], n)),n) expected
>  10
> but got
> -2
> values do not match
>
> jwe
>
>   
Grrr, ok.. In fact it seems I was wrong in that matlab doesn't ever
return a handle for the hist function. The following patch pretty much
undoes the change to hist.m and restores the matlab compatible
behavior.. Note though that it keeps the line width to the call to bar
from the previous patch..

D.

-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

*** ./scripts/plot/hist.m.orig21        2007-04-26 01:02:39.000000000 +0200
--- ./scripts/plot/hist.m       2007-04-26 18:31:42.171222525 +0200
***************
*** 118,124 ****
      freq = freq / rows (y) * norm;
    endif
  
!   if (nargout > 1)
      if (arg_is_vector)
        nn = freq';
        xx = x';
--- 118,124 ----
      freq = freq / rows (y) * norm;
    endif
  
!   if (nargout > 0)
      if (arg_is_vector)
        nn = freq';
        xx = x';
***************
*** 126,133 ****
        nn = freq;
        xx = x;
      endif
-   elseif (nargout == 1)
-     nn = bar (x, freq, 1.0);
    else
      bar (x, freq, 1.0);
    endif
--- 126,131 ----

reply via email to

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