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

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

[Octave-bug-tracker] [bug #33226] Value of variable changes unexpectedly


From: Rik
Subject: [Octave-bug-tracker] [bug #33226] Value of variable changes unexpectedly; print statement is repeated unexpectedly
Date: Wed, 04 May 2011 16:39:43 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110422 Ubuntu/10.04 (lucid) Firefox/3.6.17

Update of bug #33226 (project octave):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

This is not an Octave issue.  Your program calls


[status, num_row] = system(['cat ' temp_df '| wc -l'])


which returns num_row as a *string*, not a number.  There are probably much
simpler ways of getting your data into Octave.  But, if you continue with the
current approach you need to use 'num_row = str2num(num_row)' after the
system() call.

To see what is happening, try the following code which uses printf to print a
string using a decimal format code.  You can see that the output values are
the decimal ASCII values for 1 (49) and 0 (48) and together make the number of
rows you were expecting.


printf("%dn", "10000")
49
48
48
48
48




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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