My GUI and the corresponding Code stopped working

조회 수: 1 (최근 30일)
Sahil
Sahil 2015년 6월 4일
댓글: Sahil 2015년 6월 5일
Hi everyone,
I have come up with a very strange problem. I had a GUI+the code to communicate to a serial device and plotting the data on screen. Every thing was perfectly working till yesterday, today when I resumed my work, my GUI buttons,text inputs etc nothing work, I checked the search path if my directory is missing from the search path but everything seem to be okay.
In order to verify that the problem is not with my GUI and code, I created completely new test GUI with a single button in it such that when the button is pressed (callback function) it should display a message box i.e.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%%set(handles.pushbutton1,'String','Connect');
msgbox('Hello World');
but the GUI is not responding to its corresponding code. It looks like there is a permanent break between the GUI interface and my code.
Any idea ?
  댓글 수: 1
Adam
Adam 2015년 6월 5일
Can you attach the new GUI's .m and .fig files (the simple one you created to test).

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

답변 (3개)

Image Analyst
Image Analyst 2015년 6월 4일
Well somehow your original source code got overwritten. Take it from your back up, so maybe you'll only lose a few hours or a day of work, depending on how long ago you did your last backup. If, for some inexcusable reason, you don't have a backup, see if you can rename your m-file, or delete it if it's totally bad, and rename the .asv file to .m. The .asv file is the last version of your file and as long as you didn't save this corrupted version, it might be okay - it might possibly (if you're lucky) be your original file.
  댓글 수: 2
Sahil
Sahil 2015년 6월 5일
편집: Sahil 2015년 6월 5일
Hi,
Thank you for your valuable answer. As I mentioned the problem is not in the code because I created completely new project in another directory. The GUI contains a single button with a callback function i.e.
unction pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %%set(handles.pushbutton1,'String','Connect'); msgbox('Hello World');
Still this new project is not working. The matlab console dosent give any error or warning message.
Any idea ?
B.k Sumedha
B.k Sumedha 2015년 6월 5일
Try with another system

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


Sahil
Sahil 2015년 6월 5일
Hi,
Thank you for your valuable answer. As I mentioned the problem is not in the code because I created completely new project in another directory. The GUI contains a single button with a callback function i.e.
unction pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %%set(handles.pushbutton1,'String','Connect'); msgbox('Hello World');
Still this new project is not working. The matlab console dosent give any error or warning message.
Any idea ?

Ilham Hardy
Ilham Hardy 2015년 6월 5일
I seem to recall the same problem I've encountered, it had to do with different (I update) file name between the GUI file (.fig) with the mfile (.m). I was updating calculation on the mfile and for version management I 'cleverly' changed the filename and delete the obsolete version :(.
Could this be your problem, i.e. different filename?
  댓글 수: 4
Sahil
Sahil 2015년 6월 5일
Hi
I just checked, they are working fine. Does it mean some thing is wrong with GUIDE tool ?

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

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by