problems running .fig file

조회 수: 1 (최근 30일)
Rishabh Kasliwal
Rishabh Kasliwal 2011년 3월 1일
Hi,
I recently made a gui for manually scanning images and annotating them. It was running Ok (i.e from guide or openfig). I had done some initializations in the opening_fcn. But for some reason now when a try to open it, the initialization do not occur (i put in test strings in it) and the gui is giving me error because of undefined variables. I tried running on another machine, the same problem. If I run in debug mode then it goes through the opening_fcn and displays the string. I don't understand whats going on ??
please help
rishabh
  댓글 수: 2
Paulo Silva
Paulo Silva 2011년 3월 1일
Please copy and paste all the error message
Paulo Silva
Paulo Silva 2011년 3월 1일
just a wild guess http://www.mathworks.com/matlabcentral/newsreader/view_thread/301344

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

채택된 답변

Walter Roberson
Walter Roberson 2011년 3월 1일
Paulo's guess about you having renamed something is reasonable. I would, however, first suspect something more simple.
You cannot run a .fig file by opening it or using openfig. You must run the gui program by name; it will open the .fig file.

추가 답변 (3개)

Rishabh Kasliwal
Rishabh Kasliwal 2011년 3월 1일
thanksa lot. simply running by typing the filename works ! but I still wonder I was doing it the guide/openfig all along....
one more problem though. guide is erratic in putting callback functions automatically, for any new functionality I add to the gui. I even tried naming the callback and putting the entry in the .m file manually but it does not work. for example I have a button with tag 'jumpfile' guide did not insert the callback, so I inserted the jumpfile_Callback in the file. also added test string to the code (see below)
function jumpfile_Callback(hObject, eventdata, handles) % hObject handle to Untitled_1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) 'teststring'
but when I press that button i get the error
??? Undefined function or variable 'jumpfile_callback'.
??? Error while evaluating uicontrol Callback

Walter Roberson
Walter Roberson 2011년 3월 1일
Sorry, I have no idea why the callbacks are not being added, unless you have renamed your gui.
With respect to having added your own routine: notice that you defined a routine with a capital-C in "Callback", but it is looking for a routine with a lower-case-c "callback"

Rishabh Kasliwal
Rishabh Kasliwal 2011년 3월 1일
I was making a silly mistake by not properly naming the callbacks. now its working. thanks

카테고리

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