Problem with guidata in a callback with GUI
1 view (last 30 days)
Show older comments
Hello! I have a problem with the command 'guidata' in a GUI code. I load a matrix (mat) with a 'Push button' command in the GUI panel and plot it, and it works. Then, I need to cut this matrix by deleting some columns and rows (x vs y axes), and I do this by creating a new function with another 'Push button' command named 'Cut'. The values where I choose to cut the matrix are written in an 'Edit text' command in the GUI panel (I have four edit text commands: first column, last column, first row, last row, named x1,x2,y1,y2, respectively); when I press the Push button 'Cut' , the matrix is cut according to these values, see the code below. The problem is that I can do this only once: if I write again a value in the edit text and press 'Cut', the program doesn't work anymore. The problem should be related to the command guidata (see the line in bold in my code), because if I remove this line from the code the function works, and I can cut the matrix as long as I want. But I need to store the cut matrix as well as the values x1,x2,y1,y2, because I have to recall them in another function, so I need guidata command! How can I modify the callback to solve this problem? Thank you in advance.
Here is the callback function associated to the push button 'Cut'
4 Comments
Adam
on 18 Aug 2014
Put a breakpoint at the first line of the callback and then take a look at what handles is when you trigger it the second time.
Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!