필터 지우기
필터 지우기

Problem with guidata in a callback with GUI

조회 수: 1 (최근 30일)
aurc89
aurc89 2014년 8월 18일
댓글: Adam 2014년 8월 18일
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
aurc89
aurc89 2014년 8월 18일
@stalin samuel, it doesn't work like this
@Adam I don't know, how can I see what is in my handles structure ? I think it's a problem of overwriting
Adam
Adam 2014년 8월 18일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by