min, max skips NaN entries

View: New views
3 Messages — Rating Filter:   Alert me  

min, max skips NaN entries

by Rolf Fabian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Up to now I thought skipping NaN elements is the objective of the 'skipnan' - package.

If this was implemented into mainstream Octave and changed into a 'feature'
now, this should have been documented somewhere in order to prevent
people from wasting their precious time.

As long as it is not documented I consider this feature as a bug.


Rolf Fabian
< r dot fabian at jacobs-university dot de>


octave-3.0.0.exe:1> computer, version
i686-pc-msdosmsvc
ans = 3.0.0
octave-3.0.0.exe:2> x=[1,NaN;NaN,4]
x =

     1   NaN
   NaN     4

octave-3.0.0.exe:3> min(x)
ans =

   1   4

octave-3.0.0.exe:4> max(x)
ans =

   1   4

octave-3.0.0.exe:5> min(x.')
ans =

   1   4

octave-3.0.0.exe:6> max(x.')
ans =

   1   4
Rolf Fabian
<r dot fabian at jacobs-university dot de>

Re: min, max skips NaN entries

by Søren Hauberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


tir, 15 01 2008 kl. 06:06 -0800, skrev Rolf Fabian:
> Up to now I thought skipping NaN elements is the objective of the 'skipnan' -
> package.
>
> If this was implemented into mainstream Octave and changed into a 'feature'
> now, this should have been documented somewhere in order to prevent
> people from wasting their precious time.
>
> As long as it is not documented I consider this feature as a bug.
Isn't this just the way NaN works. I mean

octave:3> x=[1,NaN;NaN,4];
octave:4> x > 2
ans =

   0   0
   0   1

octave:5> x < 2
ans =

   1   0
   0   0

So, what else should min/max return that would be consistent with how
scalars and NaNs are compared?

Søren

>
>
> Rolf Fabian
> < r dot fabian at jacobs-university dot de>
>
>
> octave-3.0.0.exe:1> computer, version
> i686-pc-msdosmsvc
> ans = 3.0.0
> octave-3.0.0.exe:2> x=[1,NaN;NaN,4]
> x =
>
>      1   NaN
>    NaN     4
>
> octave-3.0.0.exe:3> min(x)
> ans =
>
>    1   4
>
> octave-3.0.0.exe:4> max(x)
> ans =
>
>    1   4
>
> octave-3.0.0.exe:5> min(x.')
> ans =
>
>    1   4
>
> octave-3.0.0.exe:6> max(x.')
> ans =
>
>    1   4
>
> -----
> Rolf Fabian
> <r dot fabian at jacobs-university dot de>
>

_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www.cae.wisc.edu/mailman/listinfo/bug-octave

Re: min, max skips NaN entries

by Michael Goffioul-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 1/15/08, Rolf Fabian <Rolf.Fabian@...> wrote:
>
> Up to now I thought skipping NaN elements is the objective of the 'skipnan' -
> package.
>
> If this was implemented into mainstream Octave and changed into a 'feature'
> now, this should have been documented somewhere in order to prevent
> people from wasting their precious time.
>
> As long as it is not documented I consider this feature as a bug.

Matlab behaves the same, so I don't think this will be considered as
a bug.

Michael.
_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www.cae.wisc.edu/mailman/listinfo/bug-octave