Not getting loaded!!

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

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
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
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.
They are decimal numbers and they don't have so many digits.
I have two callbacks where I load a file in the first one and pass its contents to the second function. Along with this one, I get some more inputs(the decimal numbers that I mentioned) from the user and using all these I tried to get two plots. I get problem with the second callback where the user entered input doesn't seem to get loaded to be worked with.
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.
Are you trying to do a comparison of floating point numbers using == ?
Yeah. I did the comparison in first callback function.But I didn't get any problem over there. Is there any relation?
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
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?
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.

Tags

Asked:

on 8 Jul 2018

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!