Domanda

I`m absolutely new in Matlab, so I think it is a dumb question, but I would be really grateful for any help. I had made a GUI with some slider. When I compile the m file everything works fine, there are no exceptions and the program do what it have to, but when I click on the fig file directly and try to move one of the sliders I got the following error:

??? Undefined function or method 'diference_GUI' for input arguments of type 'char'.

Error in ==>@(hObject,eventdata)diference_GUI('slider1_Callback',hObject,eventdata,guidata(hObject))

Error while evaluating uicontrol Callback

I had found some forum, blog article in this topic, but I want able to solve. Try-Catch not good, because if I do it, I dont get any error message, but the program still don`t do what it need.

Thank you for your help, Karoly

È stato utile?

Soluzione

Your question isn't quite clear, but I'm assuming that you've made a GUI called difference_GUI using GUIDE in MATLAB.

When you do this, you'll get two files, difference_GUI.m and difference_GUI.fig. At that point, you should basically leave difference_GUI.fig alone, without opening or modifying it. Start the GUI by typing difference_GUI, which will run the .m file, which uses the information in the .fig file to lay out the GUI.

If you need to modify the layout of a GUI that you've created in GUIDE, you can open the project again in GUIDE and make minor modifications to it, such as repositioning a slider - but if you need to make major changes to it, I personally find it easier to copy the algorithmic portion out of the .m file, create an entirely new project, relaid out, from scratch, and then paste the algorithmic portion back in to the new .m file.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top