help-octave
[Top][All Lists]
Advanced

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

Re: About Array Element Division Problem in Loop


From: Nicholas Jankowski
Subject: Re: About Array Element Division Problem in Loop
Date: Tue, 9 Jul 2019 11:33:54 -0400


m = 0
m = -0.040000 <---- this is actually -2/2 = -1 but octave find -0.04000
m = 0


the operation you're performing at that step is  (50-52)/50 = -0.04

you're inputting your beta_value as a character string.  so the value of ascii '2' is numerical 50, and '4' is 52.  

you should get familiar debugging with setting breakpoints in your script using the GUI or inserting the 'keyboard' command so that you can inspect variable values in the middle of execution.  Also, look at the help for sprintf.  

reply via email to

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