matlabgui數(shù)據(jù)標(biāo)準(zhǔn)管理系統(tǒng)_第1頁
matlabgui數(shù)據(jù)標(biāo)準(zhǔn)管理系統(tǒng)_第2頁
matlabgui數(shù)據(jù)標(biāo)準(zhǔn)管理系統(tǒng)_第3頁
matlabgui數(shù)據(jù)標(biāo)準(zhǔn)管理系統(tǒng)_第4頁
matlabgui數(shù)據(jù)標(biāo)準(zhǔn)管理系統(tǒng)_第5頁
已閱讀5頁,還剩13頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

程序附件1:

一、主界面:學(xué)生課程成績管理系統(tǒng)

1、打開文件按鈕:

%---Executesonbuttonpressinpushbuttons.

functionpushbutton5_Callback(hObject,eventdata,handles)

%hObjecthandletopushbuttons(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(see

GUIDATA)

globalstr;

[FileNamePathName]=uigetfile((**.xls'),*chooseaFile1);

str=[PathNameFileName];

set(handles.editl,1string',str);

2、數(shù)據(jù)庫管理按扭:

%---Executesonbuttonpressinpushbuttonl.

functionpushbuttonl_Callback(hObject,eventdata,handles)

%hObjecthandletopushbuttonl(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(see

GUIDATA)

%shujukuguanli();

globalstr;

setappdata(shujukuguanli(),,str*,str);

3、成績查詢按鈕:

%---Executesonbuttonpressinpushbutton2.

functionpushbutton2_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton2(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(see

GUIDATA)

globalstr;

setappdata(chengjichaxun(),'str',str);

5、成績直方圖按鈕:

%---Executesonbuttonpressinpushbutton4.

functionpushbutton4_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton4(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

globalstr;

setappdata(chengjizhifangtu(),,str*/str);

6、退出按鈕:

%---Executesonbuttonpressinpushbutton6.

functionpushbutton6_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton6(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

close(cjguanli());

二、子界面:數(shù)據(jù)庫管理

I、顯示整體數(shù)據(jù)按鈕:

%--Executesonbuttonpressinpushbuttonl.

functionpushbuttonl_Callback(hbject,eventdata,handles)

%hObjecthandletopushbuttonl(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%[FileNamePathName]=uiqetfile((^.xls*),*chooseaFile*);

%str=[PathNameFileName];

%set(handles.editl,*string*zstr);

globalstrl;

strl=getappdata(shujukuguanli(),'str*);

[shuzifuhao]=xlsread(strl);

hj=size(shuzi,1);

handles.xingming=fuhao(2:hj+l,1);

set(handles.listboxl,'string*,handles.xingming);

set(handles.Iistbox3,'string*znum2str(shuzi(:,2:end)));

set(handles.Iistbox2,'string’,num2str(shuzi(:,1)));

handles.chengji=shuzi(:,2:end);

handles.xuehao=shuzi(:,1);

guidata(hObject,handles);

2、設(shè)置課程學(xué)分按鈕:

%---Executesonbuttonpressinpushbutton2.

functionpushbLittoii2_Callbcick(hObject,eventdaLa,

handles)%設(shè)置各科學(xué)分

%hObjecthandletopushbutton?(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

kelxuefeng=get(handles.edit3,'string*);%各科學(xué)分

ke2xuefeng=get(handles.edit4z'string');

ke3xuefeng=get(handles.edit5,'string*);

xuefenghe=kelxuefeng+ke2xuefeng+ke3xuefeng;%三課學(xué)分之和

kelxuefengl=kelx.iefeng/xuefenghe;務(wù)各不斗學(xué)分Ji比

ke2xuefengl=ke2x_iefeng/xuefenghe;

ke3xuefengl=ke3xjefeng/xuefenghe;

kelchengjijiaquan=handles.chengji(:,1).*kelxuefengl;%各科

成績乘以占比

ke2chengjijiaquan=handles.chengji(:,2).*ke2xuefengl;

ke3chengjijiaquan=handles.chengji(:;3).*ke3xuefengl;

jiaquanchengji=kelchengjijiaquan+ke2chengjijiaquan+

ke2chengjijiaquan;

set(handles.Iistbox4r'string'rnum2str(jiaquanchengji));

3、添加按鈕:

%---Executesonbuttonpressinpushbuttons.

functionpushbutton3_Callback(hObject,eventdata,

handles)%添加函數(shù)

%hObjecthandletopushbuttons(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

globalstrl;

mima=get(handles.editll,1string');

password=11234561;

k=strcmp(mimazpassword);

ifk==0

set(handles.editll,*string',1密碼輸入錯誤請重輸!,);

return

else

namel=get(handles.edit6,*string*);

xuehaol=str2num(get(handles.edit7z'string'));

kechengll=str2num(get(handles.edit8,'string1));

kecheng21=str2num(get(handles.edit9,'string*));

kecheng31=str2num(get(handles.editlOz*string*));

handles.xingining=[handles.xingming;namel];

handles.xuehao=[handles.xuehao;xuehaol];

handles.chengji=[handles.chengji;kechengl1,

kecheng21zkecheng31];

guidata(hObject,handles);

set(handles.listboxl,*string*,handles.xingming);

set(handles.listbox2,*string*,num2str(handles?xuehao));

set(handles.Iistbox3,*string*znumzstr(handles.chengji));

xlswrite(strl,handles.xingming,1,'A2');

xlswrite(strl,handles.xuehao,1f*B2,);

1

xlswrite(strl,handles.chengjiz1zC21);

end

4、按姓名查詢按鈕:

%---Executesonbuttonpressinpushbutton6.

functionpushbutton6_Cllback(hObjectAeventdata,

handles)%姓名查詢

%hObjecthandletopushbutton6(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

globalmm;

name2=get(handles.edit6,*string*);

aa=strcmp(name2,handles.xingming);

[mmn]=find(aa==l);

xingming=handles.xingming;

xuehao=handles.xaehao;

chengji=handles.chengji;

ifmm==0

set(handles.editll,*string*,*無此人!請重輸!,);

return

else

set(handles.edits,*string',xingming(mm,:));

set(handles.edit7,*string'znum2str(xuehao(mmz:)));

set(handles.edit3,'string',num2str(chengji(mm,1)));

set(handles.edit9,*string',num2str(chengji(mm,2)));

1

set(handles.editlO,*string,num2str(chengji(mmz3)));

End

5、修改按鈕:

%---Executesonbuttonpressinpushbuttons.

functionpushbuttonsCallback(hObject,eventdata,

handles)%修改函數(shù)

%hObjecthandletopushbuttons(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

globalstrl;

mima=get(handles.editll,1string');

password='123456,;

k=strcmp(mima,password);

ifk==0

set(handles.editl1,'string,,,密區(qū)輸入錯誤請重輸!,);

return

else

namel=get(handles.edit6,*string*);

xuehaol=str2num(get(handles.edit7,1string1));

1

kechengll=str2num(get(handles.edit8zstring*));

kecheng2l=str2num(get(handles.edit9/*string*));

kecheng31=str2num(get(handles.editlO,'string'));

xingming=handles.xingming;

xuehao=handles.xjehao;

chengji=handles.chengji;

xingming(mm)=namel;

xuehao(mm)=xuehaol;

chengji(mm,:)=[kechengllzkecheng21,kecheng31];

handles.xingming=xingming;

handles.xuehao=xaehao;

handles.chengji=chengji;

guidata(hObject,handles);

set(handles.listboxl,'string1,handles.xingming);

1

set(handles.Iistbox2z'string,num2str(handles.xuehao));

set(handles.Iistbox3,'string*,num2str(handles.chengji));

xlswrite(strlzhandles.xingming,1z'A2');

xlswrite(strl,handles.xuehao,1,,B2,);

1

xlswrite(strl,handles.chengjiz1,C2');

end

7、返回按鈕:

%--Executesonbuttonpressinpushbuttons.

functionpushbutton8_Callback(hObject,eventdata,handles)

%hObjecthandletopushbuttons(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

cjguanli();

close(shujukuguanli());

三、子系統(tǒng)成績查詢:

gchengjichaxun.fig

FileEditViewLayoutToolsHelp

□di串爵韻必日圖%A

成績查詢

姓名

⑥0查

一查詢

碰TXT

姓名學(xué)號課程1課程2課程3

返回

Tag:figurelCurrentPoint[223,220]Position:[520,383,560,417]

1、姓名查詢按鈕:

%--Executesonbuttonpressinpushbuttonl.

functionpushbuttonl_Callback(hObject,eventdata,handles)

%hObjecthandletopushbuttonl(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

globalstrl;

1

name=get(handles.editlz*string);

strl=getappdata(chengjichaxun(),'str*);

[shuzifuhao]=xlsread(strl);

handles.xingming=fuhao(2:end,1);

handles.xuehao=shuzi(:,1);

handles.chengji=shuzi(:z2:end);

guidata(hObject,handles);

chengji=handles.chengji;

xuehao=handles.xaehao;

xingming=handles.xingming;

[lia,id]=ismember(name,handles.xingming);

set(handles.listboxl,'string',xingming(id,:));

set(handles.Iistbox2,'string’,num2str(xuehao(id,:)));

set(handles.Iistbox3,'string’,num2str(chengji(id,:)));

3、返回按鈕:

%--Executesonbuttonpressinpushbuttons.

functionpushbutton5_Callback(hObject,eventdata,handles)

%hObjecthandletopushbuttons(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

cjguanli();

close(chengjichaxun());

四、子系統(tǒng):成績排序

1、課程1排序按鈕:

%---Executesonbuttonpressinpushbuttonl.

functionpushbuttonl_Callback(hObject,eventdata,handles)%

按課程工降序排序

%hObjecthandletopushbuttonl(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

globalshuzi;

globalfuhao;

strl=getappdata(chengjipaixu(),'str');

[shuzifuhao]=xlsread(strl);

handles.xingming=fuhao(2:end,1);

handles.xuehao=shuzi(:,1);

handles.chengji=shuzi(:,2:end);

handles.zhongtishuju=shuzi;

zhongtishujul=sortrows(shuzi,-2);%排序

xuehaol=zhongtishujul(:,1);

chengjil=zhongtishujul(:,2:end);

hang=size(xuehaol,1);

[idlzid2]=ismember(handles.xuehao,xuehaol);

forpp=l:hang

xingmingl(id2(pp))=handles.xingming(pp);

end

xingming2=xingmingl1;

handles.xingming22=xingming2;

handles.xuehao22=xuehaol;

handles.chengji22=chengjil;

guidata(hObject,handles);

set(handles.listboxl,'string*,xingming2);

set(handles.Iistbox2,'string*rnum2str(xuehaol));

1

set(handles.Iistbox3z'string,num2str(chengjil));

2、課程2排序按鈕:

%--Executesonbuttonpressinpushbutton2.

functionpushbutton2_Callback(hObject,eventdata,handles)%

按課程2排序

%hObjecthandletopushbutton?(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%globalshuzi;

%globalfuhao;

strl=getappdata(chengjipaixu(),'str');

[shuzifuhao]=xlsread(strl);

xingming=fuhao(2:end,1);

xuehao=shuzi(:,1);

zhongtishuju3=sortrows(shuzi,-3);%排序

xuehaol=zhongtishuju3(:,1);

chengjil=zhongti3huju3(:,2:end);

hang=size(xuehaolz1);

[idl,id2]=ismember(xuehao,xuehaol);

forpp=l:hang

xingmingl(id2(pp))=xingming(pp);

end

xingming2=xingmingl,;

handles.xinqminq22=xinqminq2;

handles.xuehao22=xuehaol;

handles.chengji22=chengjil;

guidata(hObject,handles);

set(handles.listboxlz'string',xingming2);

set(handles.Iistbox2z'string*rnum2str(xuehaol));

set(handles.Iistbox3,'string',num2str(chengjil));

4、對排序結(jié)果保留按鈕:

%--Executesonbuttonpressinpushbuttons.

functionpushbutton5_Callback(hObject,eventdata,handles)

%hObjecthandletopushbuttons(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGU工DATA)

strl=getappdata(chengjipaixu(),'str');

xlswriLe(str1,handles?xiiigming22A1,'A2,);

xlswrite(strlfhandles.xuehao22z1r*B2,);

1

xlswrite(strlfhandles.chengji22z1,C2*);

5、返回按鈕:

functionpushbutton4_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton4(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

cjguanli();

close(chengjipaixu());

五、子系統(tǒng):成績直方圖

1、課程1按鈕:

%--Executesonbuttonpressinpushbutton2.

functionpushbutton2_Callback(hObject,eventdata,

handles)%課程1直方圖

%hObjecthandletopushbutton2(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionof

MATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

strl=getappdata(chengjizhifangtu(),'str*);

[shuzifuhao]=xl5read(strl);

axes(handles.axeal);

X=[5,15,25,35,45,55,65,75,85,95];

handles.chengji=shuzi(:,2:end);

kechengl=handles.chengji(:,1);

hist(kechengl,X);

2、課程2按扭:

%---Executesonbutton

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論