octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #50893] for loop index variable not initialize


From: Rik
Subject: [Octave-bug-tracker] [bug #50893] for loop index variable not initialized unless loop is entered
Date: Fri, 28 Apr 2017 14:45:15 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0

Follow-up Comment #3, bug #50893 (project octave):

More clues that this is specific to the range operator which is optimized for
space storage in Octave, but not Matlab.  If I disable Octave's efficient
range implementation then the behavior is Matlab compatible.


octave:1> disable_range (true)
octave:2> disable_range 
ans = 1
octave:3> for k = 1:0
> disp (k);
> end
octave:4> whos
Variables in the current scope:

   Attr Name        Size                     Bytes  Class
   ==== ====        ====                     =====  ===== 
        ans         1x1                          1  logical

Total is 1 element using 1 byte

octave:5> clear k
octave:6> disable_range (false)
octave:7> for k = 1:0
> disp (k);
> end
octave:8> whos
Variables in the current scope:

   Attr Name        Size                     Bytes  Class
   ==== ====        ====                     =====  ===== 
        ans         1x1                          1  logical

Total is 1 element using 1 byte





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50893>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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