MATLAB学生成绩管理系统(共6页).doc
精选优质文档-倾情为你奉上function varargout = untitled(varargin) %主函数gui_Singleton = 1;gui_State = struct('gui_Name', mfilename, . 'gui_Singleton', gui_Singleton, . 'gui_OpeningFcn', untitled_OpeningFcn, . %界面启动子函数 'gui_OutputFcn', untitled_OutputFcn, . %输出子函数 'gui_LayoutFcn', , . 'gui_Callback', );if nargin && ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);endif nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varargin:);end function untitled_OpeningFcn(hObject, eventdata, handles, varargin)handles.output = hObject;guidata(hObject, handles); function varargout = untitled_OutputFcn(hObject, eventdata, handles) varargout1 = handles.output; %-信息显示表-%function ID_Callback(hObject, eventdata, handles) %列表框学号回调子函数 function ID_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end function Name_Callback(hObject, eventdata, handles) %列表框姓名回调子函数 function Name_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end function Chinese_Callback(hObject, eventdata, handles) %列表框语文成绩回调子函数 function Chinese_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end function Math_Callback(hObject, eventdata, handles) %列表框数学回调子函数 function Math_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end function English_Callback(hObject, eventdata, handles) %列表框英语回调子函数 function English_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end function Zongfen_Callback(hObject, eventdata, handles) %列表框总分显示回调子函数 function Zongfen_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end %-信息输入表-% function Input_Callback(hObject, eventdata, handles) %弹出式信息输入列表 function Input_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end function Zhuangtai_Callback(hObject, eventdata, handles) %可编辑文本框信息状态回调子函数 function Zhuangtai_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end function Button_Callback(hObject, eventdata, handles) %确定按钮val=get(handles.Input,'Value');switch val; case 1 mess=get(handles.Zhuangtai,'string'); n1=str2double(mess) if (1999< n1)&&(n1<2011); set(handles.ID,'String',n1); else set(handles.ID,'string','NO'); end case 2 mess=get(handles.Zhuangtai,'string'); set(handles.Name,'String',mess); case 3 mess1=get(handles.Zhuangtai,'string'); set(handles.Chinese,'String',mess1); case 4 mess2=get(handles.Zhuangtai,'string'); set(handles.Math,'String',mess2); case 5 mess3=get(handles.Zhuangtai,'string'); set(handles.English,'String',mess3); mess1=get(handles.Chinese,'string'); mess1=str2double(mess1); mess2=get(handles.Math,'string'); mess2=str2double(mess2); mess3=str2double(mess3); handles.mess3=mess3; sum=mess1+mess2+mess3; set(handles.Zongfen,'String',sum); guidata(hOject,handles); end %-查询框信息-%function Chaxun_Callback(hObject, eventdata, handles) %可编辑文本框查询输入回调子函数 function Chaxun_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end function Search_Callback(hObject, eventdata, handles) %搜索按键mess1=get(handles.Chaxun,'string'); mess=str2double(mess1);mess2=get(handles.ID,'string'); n1=str2double(mess2);mess3=get(handles.Name,'string'); %n2=str2double(mess3);if (mess=n1)|(mess1=mess3) mess=get(handles.Chinese,'string'); set(handles.ChaxunC,'String',mess); mess1=get(handles.Math,'string'); set(handles.ChaxunM,'String',mess1); mess2=get(handles.English,'string'); set(handles.ChaxunE,'String',mess2); mess=str2double(mess); mess1=str2double(mess1); mess2=str2double(mess2); sum=mess+mess1+mess2; set(handles.ChaxunZ,'String',sum); end function ChaxunC_Callback(hObject, eventdata, handles) %可编辑文本框查询语文显示回调子函数 function ChaxunC_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end function ChaxunM_Callback(hObject, eventdata, handles) %可编辑文本框查询数学显示回调子函数 function ChaxunM_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end function ChaxunE_Callback(hObject, eventdata, handles) %可编辑文本框查询英语显示回调子函数 function ChaxunE_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end function ChaxunZ_Callback(hObject, eventdata, handles) %可编辑文本框查询总分显示回调子函数 function ChaxunZ_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end function ChaxunP_Callback(hObject, eventdata, handles) %可编辑文本框查询排名显示回调子函数 function ChaxunP_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end专心-专注-专业