function varargout = attendancetable_1(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @attendancetable_1_OpeningFcn, ...
'gui_OutputFcn', @attendancetable_1_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
function attendancetable_1_OpeningFcn(hObject, eventdata, handles, varargin)
global p
p.MyData=[];
handles.output = hObject;
guidata(hObject, handles);
function varargout = attendancetable_1_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
function pushbutton1_Callback(hObject, eventdata, handles)
global p
NameData = get(handles.NameField, 'string');
RegisterNumberFieldData = get(handles.RegisterNumberField, 'string');
p.MyData= [p.MyData ; [{NameData} {RegisterNumberFieldData}]];
set(handles.TableField, 'Data',p.MyData)
function NameField_Callback(hObject, eventdata, handles)
function NameField_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function RegisterNumberField_Callback(hObject, eventdata, handles)
function RegisterNumberField_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function TableField_CellEditCallback(hObject, eventdata, handles)
function Print_Callback(hObject, eventdata, handles)
global p
filename='Students.xlsx';
xlswrite(filename,p);
p=p+1;
>> attendancetable_1
Error using xlswrite (line 170)
Input data must be a numeric, cell, or logical array.
Error in attendancetable_1>Print_Callback (line 145)
xlswrite(filename,p);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in attendancetable_1 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)attendancetable_1('Print_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.