西安邮电大学MATLAB及其EDA仿真《基于GUI的学生成绩管理系统》设计报告院(系)名称:电子工程学院学生姓名:专业名称:集成电路设计与集成系统班级:电路1303一.设计题目概述设计题目:基于GUI的学生成绩管理系统。设计要求:利用MATLAB的图形用户界面,设计完成成绩管理系统,系统包括增加、删除、查询、统计等功能。增加学生信息,删除学生信息,查询学生信息,统计学生的成绩。二.设计方案1•新建一个新的excel表格,并录入初始信息。2•新建一个新的GUI设计。3•在GUI界面中添加文本框和菜单栏以及按钮。4•给各个文本框菜单栏以及按钮添加属性。5•编辑回调函数,实现各个功能。三.设计内容1、建立Listbox文本框,分别为姓名、学号、Verilog成绩、MATLAB成绩、DSP成绩、半导体器件成绩、计算机组成与设计成绩。设置属性。2、建立可编辑文本框,对应Listbox注释,设置属性。3、添加按钮,进行查询、删除、增加、统计。4、编辑查询按钮的回调函数。functionpushbutton2_Callback(hObject,eventdata,handles)prompt={'inputxingming'};title='find';chaxun_xingming=inputdlg(prompt,title);ax=strcmp(handles.xingming,chaxun_xingming);[i,j]=find(ax==1);set(handles.xingming_1,'string',handles.xingming(i,1));set(handles.xuehao_1,'string',handles.xuehao(i,1));set(handles.verilog_1,'string',num2str(handles.verilog(i,1)));set(handles.matlab_1,'string',num2str(handles.matlab(i,1)));set(handles.dsp_1,'string',num2str(handles.dsp(i,1)));set(handles.bandaoti_1,'string',num2str(handles.bandaoti(i,1)));set(handles.jisuanji_1,'string',num2str(handles.jisuanji(i,1)));guidata(hObject,handles);5、编辑增加按钮回调函数。先将文本框中的内容赋值给中间变量,再将值插入到表格中,再把全局变量依次插入到表格中,再读取表格,最终实现增加。6、统计按钮回调函数。统计要实现学生总分的统计。handles.zongfen=handles.verilog+handles.matlab+handles.dsp+handles.jisuanji+handles.bandaoti;set(handles.zongfen_1,'string',num2str(handles.zongfen));7、删除按钮回调函数。先查找到要删除的信息,把全局变量的要删除的信息的前后内容进行拼接,由此实现了要删除内容的删除。之后再赋值给表格,再读取一次表格的信息,从而实现了,删除的功能。运行后的效果图四.注意事项与心得体会1、每次增加信息或删除信息要重新更新表格,否则下次打开后之前的操作无效。2、MATLAB有强答的数学计算能力,使其在编程方面比较简便。附录代码如下:functionvarargout=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',[]);ifnargin&&ischar(varargin{1})gui_State.gui_Callback=str2func(varargin{1});endifnargout[varargout{1:nargout}]=gui_mainfcn(gui_State,varargin{:});elsegui_mainfcn(gui_State,varargin{:});endfunctionuntitled_OpeningFcn(hObject,eventdata,handles,varargin)handles.output=hObject;ha=axes('units','normalized','position',[0011]);uistack(ha,'down')II=imread('Î÷ÓÊ.jpg');image(II)colormapgrayset(ha,'handlevisibility','off','visible','off');guidata(hObject,handles);[a,b]=xlsread('student.xls');handles.verilog=a(:,1);handles.matlab=a(:,2);handles.dsp=a(:,3);handles.bandaoti=a(:,4);handles.jisuanji=a(:,5);handles.xingming=b(2:end,1);handles.xuehao=b(2:end,2);set(handles.xingming_1,'string',handles.xingming);set(handles.xuehao_1,'string',handles.xuehao);set(handles.verilog_1,'string',num2str(handles.verilog));set(handles.matlab_1,'string',num2str(handles.matlab));set(handles.dsp_1,'string',num2str(handles.dsp));set(handles.bandaoti_1,'string',num2str(handles.bandaoti));set(handles.jisuanji_1,'string',num2str(handles.jisuanji));guidata(hObject,handles);functionvarargout=untitled_OutputFcn(hObject,eventdata,handles)varargout{1}=handles.output;functionxingming_1_Callback(hObject,eventdata,handles)functionxingming_1_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionxuehao_1_Callback(hObject,eventdata,handles)functionxuehao_1_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionverilog_1_Callback(hObject,eventdata,handles)functionverilog_1_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionmatlab_1_Callback(hObject,eventdata,handles)functionmatlab_1_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctiondsp_1_Callback(hObject,eventdata,handles)functiondsp_1_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionbandaoti_1_Callback(hObject,eventdata,handles)functionbandaoti_1_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionjisuanji_1_Callback(hObject,eventdata,handles)functionjisuanji_1_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionpushbutton2_Callback(hObject,eventdata,handles)prompt={'inputxingming'};title='find';chaxun_xingming=inputdlg(prompt,title);ax=strcmp(handles.xingming,chaxun_xingming);[i,j]=find(ax==1);set(handles.xingming_1,'string',handles.xingming(i,1));set(handles.xuehao_1,'string',handles.xuehao(i,1));set(handles.verilog_1,'string',num2str(handles.verilog(i,1)));set(handles.matlab_1,'string',num2str(handles.matlab(i,1)));set(handles.dsp_1,'string',num2str(handles.dsp(i,