Keep the variable of ediTtext if you don't change it
1 次查看(过去 30 天)
显示 更早的评论
Hello, I want to do a GUI that have 4 editText, 1 pushbutton and 1 table. I want to put the info of the editText in the table. When I put the values in the editText and I push the button, it puts in the table. If I don't change anything and I push the button, the gui don't catch the values of the editText. If I change the values all the time I don't have this problem.
- Example: I put the values 4 5 6 7 into the text box
- I hit the button (the values get put into the table)
- I hit the button without changing the values (Here is my problem!)
0 个评论
回答(1 个)
Image Analyst
2017-12-2
What is the code in the callback for the push button? If it extracts the edit text string, and parses it, and puts it into the table, it will work regardless if the text has been changed or not. It simply works on the current string in the edit text box.
2 个评论
Image Analyst
2017-12-2
set a breakpoint in that function. Does it step on the same lines of code in the two cases? What are the values of the variables? Just do normal debugging and you should be able to figure it out.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Data Preparation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!