I've been building/coding a GUI (using GUIDE). At some point I "forked it". That is, my Sensor_Analysis.fig & .m files are now Sensor_Analysis2.fig & .m. Some time later this thing became broken, and it makes absolutely no sense why I'm getting a (totally uninformative) error.
The way my GUI works is I have a "load files" button, and it does some calculations after files are loaded. Then I have buttons for plotting and saving. The load files callback runs with no errors, but when I subsequently click the other buttons, I get this error:
Undefined function or variable 'Sensor_Analysis_2'.Error inmatlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)Sensor_Analysis_2('pushbutton_plotVcurves_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback
If I put in a breakpoint in the editor right at the end of my load files button callback, run the code up to that point, and then simply copy the next button's code into the Matlab command window, and execute it, then it works! But as soon as I try to use the button in the GUI again, I get the error.
What's going on here?? Really mystified and frustrated.
Best Answer