I tried this code,
function pushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[FileName,PathName] = uigetfile('*.mat','Select mat file');if FileName==0, return, endStruct1 = load( fullfile(PathName,FileName) ); %# pass file path as string
Structname = fieldnames(Struct1); end%# typo?
But its showing the following error:
Error using fevalUndefined function 'pushbutton1_Callback' for input arguments of type 'struct'.Error in gui_mainfcn (line 95) feval(varargin{:});Error in compgui (line 42) gui_mainfcn(gui_State, varargin{:});Error in @(hObject,eventdata)compgui('pushbutton1_Callback',hObject,eventdata,guidata(hObject))Error while evaluating uicontrol Callback
Can anybody please help me out with this
Thank you
Deepa
Best Answer