From help-octave-request at bevo dot che dot wisc dot edu Fri Oct 24 15:34:01 2003 Subject: Index expressions, boolean types and numerical types From: Greg Novak To: help-octave at bevo dot che dot wisc dot edu Date: Fri, 24 Oct 2003 15:30:13 -0500 Does Octave have boolean types? Does it keep track of them silently? How do you do casts between numerical types and boolean types? If there are no boolean types, then how does the following fragment of a session make sense? octave:68> y=1:10 y = 1 2 3 4 5 6 7 8 9 10 octave:69> y(y<11) ans = 1 2 3 4 5 6 7 8 9 10 octave:70> k=y<11 k = 1 1 1 1 1 1 1 1 1 1 octave:71> y(k) ans = 1 2 3 4 5 6 7 8 9 10 octave:72> k=ones(1,10) k = 1 1 1 1 1 1 1 1 1 1 octave:73> y(k) ans = 1 1 1 1 1 1 1 1 1 1 octave:74> k looks exactly the same when I assign it by k=y<11 or k=ones(1,10), but the behavior of y(k) is very different in the two cases. What gives? Thanks, Greg ------------------------------------------------------------- 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 -------------------------------------------------------------