matlabGUI用户界面设计学生成绩管理系统完整截图
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
E23 ▼ A BCD English
ID
nam e
009937538743664
15 6 9 3 53 8436 4
3
504789548354664 4687775582 56 4
458566664
4 5 5 6 6
6 4
謹
s s
粋壽蠶鬻
SI
Fil* Ueit Sal?
A J - ■
a •F nt '33 a ■
□
为
function pushbutt on 1..Callback (hObject, ev&nt data, handles)
□ % hObject handle to pushbutt on 1 (see GCBO)
% event data reserved - to be defined in a future version of MATLAB
% handles structure with handles and user d^ta (see GUIDATA)
[ij name]^xlsreadf student ・ xlsx");
handles. ID=a(:j 1);
handles・ English=a(:^ 2):
handles. Math=a(:, 3):
handles・ najne=name (2: end^ 1);
guidataChObject, handles):
set (handles, listboxU ' st ring\ handles. name);
set (handles. Iistbox2, ' strmg\ handles. ID):
set (handles. Iistbox3,' string7,handles.English):
set (handles, listbox^ r string75 handles. Nath);
guidata(hObject, handles):
function 卩ushbutton2..Callback<hObject, eventdata3 handles)
% hObject handle to pu.shbutton.2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA) button=Questdlc(,是否确认关闭’,’关闭确认',’是',’否',’是'):if strcmp (button,'是’) close
else
ret urn;
end
[a^name] =xlsread(,student .xlsx'):
guidata(hObject, handles):
set (handles, edit 1, string handles, guanbi):
UKDUUlPb UXl UUllUIl piDAb XII pU^XlUUL I. UIl J.
耳function pushbutton3..Callbaclc (hObjectj event data^ handles)
申%kObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA) prcanpt={ input name }: t itle=' input name";
najr.e= input dig (prompt, title);
i=strcmp (handles・ nanej nanie);
[t»j l]=find(i=l):
set (handles, listb0x1$ * string,s (hj 1)):
set (handles. Iistbox2,' string', handles. ID(h, 1));
set (handles. Iistbox3s* st ring *, handl es. Engli sh (h, 1)):
set (handles, listbox^ ' st ring \ handles. Nath (h^ 1)):
S
funct i on pushbutton4..Cal l*back (hObject^ event dat① handles)
% hObject handle to pushbutton4 (see GCBO)
% event data reserved - to be defined in a future version of KATLAB -% handles structure with handles and user da^a (see GUIDATA)
prompt = V delete name'}:
■title=* delete name* :
nane= inputdlg(prompttitle);
i=5trcmp (handles.naniE, name):
[row, ^ol]=find(i==l);
handles.Tiame(row^ :)=[]:
handles. ID (rov, :)=[]:
handles.Eng 1 ish(r cvr, :) = []:
1 iaiidles.Math(ro:)=[].
set(handles・ Listboxl, ' string*, handles・ name):
set (handles. list'box2J J string5, handles. ID):
set (handles・ Listbox3, ' st ring*, handles・ English);
set (handles. Listbox^ J string53 handles. Math);
•9
x= ;
xlswrite C student.xlsx,, x』^2:2100"):
xlswrit e (' student, xlsx7, handles・ name, * Sheet 1?, A2?);
xlswrit e C student. X I SK*, handles・ ID』'Sheet 1'』'):
xlswrite C student.xlsx,, handles. English,J Sheet 1:,' C2‘ );
・xlswrite C studerrt.xlsx*, handles・ Math, Sheet ' D2‘ ):
function pushbut t on5.. C a 1 lb ack (hObject, event da: handles) % hObject handle t o pushbut t on5 (see GCBO)
prompt= {' najne\ 'ID' J English',' Hath'}: title= new student' : lines=[1 1 1 1]:
answer=inputdlg(prompt,ti11e, lines): n = length (handles, rtajue): handl e s. name {n+1, l}=ans'wer {1, 1}; handles. ID (n+1 j 1) =?.txZxWB (answer {2, 1});
handles.English(n+1, 1) = str2nuHi(answer {3^ 1}): handles. Math(n*+l, l)=str2nuni(answer {4, 1});
gui dat a (hOb j e ct, handl e s):
set (handles ・ listboxl, ' string", handles, name): set (handles ・ lis±box2s ' string 7、handles. ID); set (handles, list box 3,' st ring *, handles. English): (handles, listbox!, stxing ,
, handles. Math). 9
9
x= :
xlsvrite(, st udent. xlsx \ x, ? A2: Z100*): xlsvrite (' st udent ・ xLsx'」handles ・nam 巴,'Sheet T , A2): xlsvrite (' student ・ xlsx ,t , handles ・ ID,' Sheet TB?'); xlswr ite (' st udent ・ xlsx ? j handles .English 」7 Sheet 17 j ? C2'); xlswrite (r st udent. x 丄 sx\handles .Math,' iheet V ,' DZ"):
for.ction pcpupnenul .Callback (hObiect. eventdata, handles) E% l.Object handle to popupnenul (see GCEO)
% cvontdats rosorvod - to bo dofinod in s future vorsion of MATLA3
-% handles structure wilh handles and user data (see GUIDATA)
% Eints: coni ents = cellstr (gel QiObject,J String*)) returns popupnenul cont ent 3 as cell array % cont onto {got (hCbjoct., 7 Valuo^ ) } returns soloct cd item from popupnonul st i=get (hObject, String') val=get (hObject,' Value*);
switch stc Ival);
caffe English'
handles ・ curr ent _ dat a=handle s .English: bar(handles ・English);
cac ' Math*
handle?・ current_d^t azhindlec ・ Math :
bar (handles. Hath)
enc
gaddata (hObjcctjhandles);
S
% eve nt data reserved. - to be defined in a future version of MATLAB
% handles structure vith handles and user data
(see GUIDATA)
04
姓名学号英语数学
杭讨
A104/>454104 108
109
52
789
44
55
8
55
66
66
66
6
44
V
84
77
78
79
55
54
88
23
5
54
66
6
44
69
99
33
7
55
33
8
87
344
33
66
6
44
V V V
iro
83
60
40
33
学生成绩管理系统
delete .
姓名学号
50
69
99
33
7
5s
a3
o
e7
w
33
66
6
"
:?
瓷
;:
"
需
工
.
益
input naae 匸]|口J
区] input name
成绩统计绘图
关闭
[OK ] [ 8耐1 ]
英语数学
人1088469
o
45
□叵区
是否确认关讯
ILH 〕d
)nev stu•・
•匚| j
区)
5069993375533887344336664478
6084777879555485235546664498
16
学生成绩管理系统
13
8.8
SB
7
3?
「
e
r
-.-
_
3
l
I
R
44
.X
名
n
奄
兰
r)
«
*
4l
今
r
G
w
囲
E
T
«
%
H
伊
色。
I-E
X
夕
G
lo
IT
r
.
:
*
巾
:
B C D
ID English Math
104:4510
1056050
1088469
1097799
527833
789797
445555
555433
8888
552387
665344
665433
666666
666
4:4:4444
369878
10 11 12 13 14 15。