Not getting loaded!!
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Have anyone faced a problem where the values entered in your edit text box doesn't get loaded in your gui for any calculations or stuff??
11 Comments
Image Analyst
on 8 Jul 2018
Not me. How many characters did you enter, and did it go past the right edge of the edit box and have to scroll the characters to the left (not that that should matter at all)?
dpb
on 8 Jul 2018
The specific callback is pretty generally not a problem; folks often run into problems when there's more than one control and getting data from one callback function to another...
As almost always the case, takes specifics for the given instance to be able to deduce what might be the problem.
Jan
on 8 Jul 2018
what exactly does "the values entered in your edit text box doesn't get loaded" mean? Please post the relevant part of the code and explain, what you observe. Currently a specific answer is not possible due to the absence of details in the description of the problem.
new user 00
on 8 Jul 2018
new user 00
on 8 Jul 2018
Walter Roberson
on 8 Jul 2018
Double precision numbers can only reliably store 15 digits.
If the differences you are seeing are in digits before that point, then it might be a matter of how you are displaying the values. Use
format long g
and display the values in the command window. The variable browser has a Preference that controls which format it uses.
Walter Roberson
on 8 Jul 2018
Are you trying to do a comparison of floating point numbers using == ?
new user 00
on 8 Jul 2018
Walter Roberson
on 8 Jul 2018
The only time you should do comparisons for floating point equality are if you know for sure that the value will be present (or definitely not present) because you extracted the value from a source that was copied exactly into the value being searched. For example it is fine to use
t = min(YourArray(:));
find(YourArray == t)
because t is a bit-for-bit copy of some value in YourArray.
But if you had, for example,
m = 0:.01:1;
n = m * 100;
find( n == 7 )
then even though algebraically 7 occurs in m, because of floating point round-off, there might not be any exact 7 in n. Indeed, n(8) will not be exactly 7, it will probably be 7 + 8.88178419700125e-16 in this case.
Rik
on 8 Jul 2018
And to ask for a confirmation (because many people tend to forget): did you convert the char array to a numeric?
Image Analyst
on 8 Jul 2018
New user, Jan and I are asking for the specific lines of code where you get the string value from the edit text box, convert it to a number ( if you even did so), and check on the number of decimal places. Please provide your code so we can quit guessing and answer your question definitively.
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!