Error while evaluating uicontrol Callback
4 次查看(过去 30 天)
显示 更早的评论
I created pushbutton in GUI;
% --- 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)
[FileName1,PathName] = uigetfile('*.xlsx','Select the excel file');
[num,txt1,raw] = xlsread(FileName1);
%when user click pushbutton then click close the "select the excel file" window following errors occur;
Error using xlsread
Filename must be a string.
Error in helmert_fig>pushbutton1_Callback (line 84)
[num,txt1,raw] = xlsread(FileName1);
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in helmert_fig (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)helmert_fig('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
%how I can modify the xlsread function to supress these errors when user close the window without select any file to read?
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!