A PB GUI enters the callback routine, upon completin of the callback routine, it jumps to the gui_mainfcn.m..I expected it to return to the GUI without calling the gui_mainfcn.m
Show older comments
I'm running a small gui code, started from the GUIDE command, selected blank, then added a PB, when the PB is selected, execute code:
% --- Executes on button press in pushbutton1. 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)
[filename, pathname, filterindex] = uigetfile('*.*', 'Select blackbox data file in XL format'); filelocation=strcat(pathname,filename);
[num0,txt0]=xlsread(filelocation,1); %buffer 0
This works fine, it opens a file I select, it does the xlsread as shown.....when it finishes that line of code, it then jumps/calls the gui_maninfcn.m which then wipes out the workspace and the variables that were just created....
It seems I am not correctly ending the pb callback code which then causes it to run the gui_mainfcn.m code.....
need help to understand this novice error...
thanks gary
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements 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!