GUI Has Error Although It Worked Fine Before and I Did Not Change Code
6 views (last 30 days)
Show older comments
Hi, when I first created my GUI everything worked fine. Then I closed Matlab, reopened my GUI and ran it and now it won't run because it has errors in its internal function when it worked fine before. I did not change anything in my code so I don't understand why it's no longer working when I reopen Matlab. I attached my code below. This is the error message I receive:
Undefined function or variable 'writePWMDutyCycle'.
Error in code1>pushbutton1_Callback (line 98)
writePWMDutyCycle(a,'D10',0);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in code1 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)code1('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback
This is my first time posting so please let me know if I need to clarify anything or change my formatting.
6 Comments
Walter Roberson
on 2 Sep 2017
Edited: Walter Roberson
on 2 Sep 2017
To confirm: after the problem occurs, does
C:\ProgramData\MATLAB\SupportPackages\R2017a\toolbox\matlab\hardware\supportpackages\arduinoio\@arduino\arduino.m
still exist?
If you execute the command
clear all
and run again, does it start working? How about if you
rehash toolboxcache
then does that start it working?
Another thing to try is
fclose('all')
when the problem has occurred.
It is certainly an odd situation.
Answers (0)
See Also
Categories
Find more on Arduino Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!