[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: bug in a(a<3)?

**From**: |
Daniel Heiserer |

**Subject**: |
Re: bug in a(a<3)? |

**Date**: |
Mon, 06 Sep 1999 15:04:08 +0200 |

address@hidden wrote:
>* *
>* Daniel Heiserer wrote:*
>* >*
>* > Hi it seems that I found something really strange.*
>* > octave:1> a=rand(3)*
>* > octave:2> a(a<3)*
>* > octave:3> a(a<0.4))*
>* > For me it seems that octave makes it right for 0.4 but wrong for 3.*
>* *
>* If you look at (a<3) it comes out all ones, while (a<0.4) with a high*
>* probability comes out with at least one zero. Octave can in the latter*
>* case deduce that you want to select items, but in the first case it*
>* is ambiguous and the result depends on how you've set a certain built-in*
>* variable (another reply to your query gives the name of the variable).*
>* Your default setting obviously treats [1 1 1] as three copies of '1'*
>* and not as three cases of "yes, include me."*
Sorry, I don't understand the philosophy behind:
'and not as three cases of "yes, include me."'
Is this a true/false 1?
For my understanding a([1 1 1 ]) should give out
a vector 1x3 each containing a_1. Assuming
a is a matrix I would expect the first value
according the actual sorting OR an error message.
daniel
---------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL. To ensure
that development continues, see www.che.wisc.edu/octave/giftform.html
Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
---------------------------------------------------------------------