




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、題目:計(jì)算器完成一個(gè)簡(jiǎn)單的計(jì)算器。要求(但不限于):GUI 上具有數(shù)字鍵盤輸入?yún)^(qū)域,能夠進(jìn)行加、減、乘、除、三角函數(shù)等基礎(chǔ)運(yùn)算。界面簡(jiǎn)潔、美觀可能需要的控件:PushButtonEditTextPop-upMenu1功能介紹本程序是一個(gè)簡(jiǎn)單的計(jì)算器程序,使用 MATLAB 軟件編寫完成。主要具有加、減、乘、除、三角函姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044基于MATLAMATLA-GUI-GUI的簡(jiǎn)單計(jì)算器設(shè)計(jì)圖 1 程序的交互界面1 1/2424數(shù)等基礎(chǔ)運(yùn)算,并通過(guò) GUI 進(jìn)行程序使用的交互。程序交互界面如下:2功能實(shí)現(xiàn)首先用 MATLABGUI 功能,在繪制一個(gè)動(dòng)
2、態(tài)文本框和一個(gè)文本編輯框,以及 25 個(gè)命令按鈕,調(diào)整好各控件大小、顏色,整體布局如圖所示:備注:軟件版本:MATLABR2011bMATLABR2011b2.12.1布局GUIGUI1、打開(kāi) MATLAB,在 Guide 中新建 FIG 文件MATLABR2OllbMATLABR2OllbFFFFIIOEdEd征D-ebugD-ebugPareilielDesktopWindowHPareilielDesktopWindowH亡IpIpINfrwINfrwSeriptCtrl+bJSeriptCtrl+bJtoFOpen.Open.Ctrl-J-OCtrl-J-OFunctionFuncti
3、onCloseCommandWindowCloseCommandWindowCtrl+WCtrl+WClas-s.Clas-s.EnumerationEnumerationImportData,-.ImportData,-.FigureFigureVariablvVariablvModelModelGUIGUIDeploymentProject.DeploymentProject.Savs*WorkpaceASavs*WorkpaceA弓川.SetPath.SetPath.PrefcrenPrefcren匚。與.”P3gleSetup.P3gleSetup.Ctrl+SCtrl+SPnntrP
4、nntr b bCtrl-I-PCtrl-I-PCodeGemerataonPrcjectCodeGemerataonPrcjectJ+J+SimulinkProj&ctr.SimulinkProj&ctr.1 1C:C:口弋 k 論文題目untiHuntiH音clLmclLm2 2D D:V-Sfurdcgui_mainfcn.mV-Sfurdcgui_mainfcn.m3 3D:,r r,Q,Qdetooldetoolsnotebooksnotebookr rm m4 43bexmO603Dl.m3bexmO603Dl.mExitMATLABCtrl+QExitMATLABCtrl+Q姓名
5、:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):12084410442 2/2424GUIDEGUIDEtemplatesRlnkGUl(口面用血GUIwithUiconlrolsUiconlrolsGUIwithAxesandandMenuModalQuesUonDhalogiDhalogi2、然后雙擊“BlankGUI(Default)”或單擊 OK 鍵出現(xiàn) GUI 窗口3、添加按鈕和動(dòng)態(tài)文本框口總用溫電G串自犀母圖啰 A3 3/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044怛 NEWGUj|OpenOpenExistingGUISaveonstarluDas:OKCan
6、celHelpCancelHelpPushButtonPushButtonStaticTextStaticTextPushBurttonPushBurttonPushButtonPushButtonPreviewPreviewBLANKBLANK4、根據(jù)按鈕的作用及視覺(jué)效果做一定的修改對(duì)按鈕的字符串大小、顏色進(jìn)行設(shè)置,對(duì)按鈕的位置進(jìn)行排布,盡量使按鈕集中在動(dòng)態(tài)文本框下面。最終設(shè)置的動(dòng)態(tài)文本框?yàn)榛疑?,其他按鈕均為藍(lán)色。5、保存、添加功能函數(shù)將做好的按鈕及動(dòng)態(tài)文本框保存后自動(dòng)彈出函數(shù)。 以下是相應(yīng)按鈕的功能函數(shù)。(1)數(shù)字按鍵編寫。在 functionpushbutton1_Callback(hO
7、bject,eventdata,handles)下輸入:個(gè)0,然后由 set(handles.edit1,String,a)在edit1中輸出。同理,分另1J 在 functionpushbutton210_Callback(hObject,eventdata,handles)下給此類程序。(2)符號(hào)鍵:在 functionpushbutton11_Callback(hObject,eventdata,handles)下輸入:globaljjglobalja=get(handles.edit1,a=strcat(a,+)if(jj=0)set(handles.edit1,jj=1;endj=0
8、;strcat 的作用是將兩個(gè)字符串連接起來(lái),就是在已輸入的存儲(chǔ)數(shù)據(jù) a 后添加“+”進(jìn)行運(yùn)算。然后執(zhí)行set(handles.edit1,String,a)。符號(hào)鍵-、 *、 /、 .與+的運(yùn)算函數(shù)類似,“平方運(yùn)算”主要是由“人 2”功能實(shí)現(xiàn)。functionpushbutton12_Callback(hObject,eventdata,handles)globaljjglobalja=get(handles.edit1,String)a=strcat(a,-)if(jj=0)set(handles.edit1,String,a)jj=1;end4 4/2424姓名:曹慈航班級(jí):12級(jí)電氣自
9、動(dòng)化2班學(xué)號(hào):1208441044Editor 的 M 文本,然后對(duì)相應(yīng)的pushbutton 添加功能globaljja=get(handles.edit1,if(strcmp(a,0.set(handles.edit1,elseString尸=1)&(jj=0)String);,0.)a=strcat(a,set(handles.edit1,end0)String,a)jj=0這是使用句柄 handles 指向?qū)ο骵dit1,并以字符串形式來(lái)存儲(chǔ)數(shù)據(jù)文本框edit1的內(nèi)容,并存儲(chǔ)數(shù)19 數(shù)字按鍵下編寫String)String,a)j=0;functionpushbutton13_Call
10、back(hObject,eventdata,handles)globaljjglobalja=get(handles.edit1,String)a=strcat(a,*)if(jj=0)set(handles.edit1,String,a)jj=1;endj=0;functionpushbutton14_Callback(hObject,eventdata,handles)globaljjglobalja=get(handles.edit1,String)a=strcat(a,/)if(jj=0)set(handles.edit1,String,a)jj=1;endj=0;functionp
11、ushbutton15_Callback(hObject,eventdata,handles)globaljjglobalja=get(handles.edit1,String)a=strcat(a,.)if(jj=0)set(handles.edit1,String,a)jj=1;endj=0;functionpushbutton16_Callback(hObject,eventdata,handles)“eval”的作用是將符號(hào)表達(dá)式轉(zhuǎn)換成數(shù)值表達(dá)式再由5 5/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044a=get(handles.edit1,b=eval(a)
12、set(handles.edit1,(3)運(yùn)算符“=”a=get(handles.edit1,b=eval(a)set(handles.edit1,StringString的編程:stringstring),num2str(bA2),num2str(b)set(handles.edit1,String,0)(6)三角函數(shù)的編輯functionpushbutton17_Callback(hObject,eventdata,handles)a=get(handles.edit1,String);b=eval(a)b=b*pi/180;b=sin(b);set(handles.edit1,Strin
13、g,b)b=b*pi/180 是把角度轉(zhuǎn)換為弧度,這樣在編程環(huán)境中才能識(shí)別,sin 才能起作用。然后執(zhí)行結(jié)果輸出來(lái)。同理在 cos,tan,cot 的回調(diào)函數(shù)中也輸入相應(yīng)的函數(shù),只需把b=sin(b);中的tan,cot 即可(7)按鍵“()”:在輸入數(shù)據(jù)時(shí)添加括號(hào),以便數(shù)據(jù)的優(yōu)先計(jì)算。globaljj姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044set(handles.edit1,輸出。String,num2str(b)(4)按鍵back編程:即顯示一個(gè)空字符:set(handles.edit1,String,a)按鍵“back”編程:globaljja=get(handl
14、es.edit1,if(strcmp(a,0.set(handles.edit1,elsess=char(a);l=length(a);a=ss(1:l-1);set(handles.edit1,String);)=1)&(jj=0)String,0.)String,a)endjj=0;(5)按鍵“清零”把動(dòng)態(tài)文本框的字符清空,返回一個(gè)空格。a=get(handles.edit1,String)if(strcmp(a,0尸=1)&(jj=0)set(handles.edit1,String()elsea=strcat(a,()set(handles.edit1,endjj=0String,a)
15、a=get(handles.edit1,s1=strcat(a,)set(handles.edit1,String)String,s1)6 6/2424set 函數(shù),把sin 改為 cos,2.2計(jì)算器的使用加法運(yùn)算(+):姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044按“=”后顯示:減法(-)、乘法(*)、除法(/)運(yùn)算與加法(+)運(yùn)算類似。7 7/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044點(diǎn)號(hào)(.)、括號(hào)()nuntitleduntitled】8 8/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044平方(XA2)運(yùn)算:
16、按下(XA2)后9 9/2424三角函數(shù)(sin、cos、tan、cot)運(yùn)算:姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044按下(sin、cos、tan、cot)后1010/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044back、清零功能:1111/24243程序總結(jié)本程序?qū)崿F(xiàn)簡(jiǎn)單的科學(xué)運(yùn)算功能及便捷的圖形化交互界面。具有以下優(yōu)點(diǎn):優(yōu)點(diǎn):1、GUI 內(nèi)數(shù)據(jù)傳遞非常簡(jiǎn)便。非常簡(jiǎn)便的實(shí)現(xiàn)了前臺(tái)與后臺(tái)、前臺(tái)與前臺(tái)、后臺(tái)與后臺(tái)之間的參數(shù)傳遞。2、圖形化用戶交互界面簡(jiǎn)潔明了。在制作計(jì)算器界面時(shí)操作簡(jiǎn)單,制作完成后程序的輸入框直接彈出,可以直接寫入,即可運(yùn)行計(jì)
17、算器。簡(jiǎn)單的實(shí)現(xiàn)了設(shè)計(jì)與編程的數(shù)據(jù)傳遞。1212/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):12084410444課程總結(jié)1、通過(guò) MATLAB 簡(jiǎn)單計(jì)算器的設(shè)計(jì),初步了解了關(guān)于 MATLAB 圖形用戶界面的部分控件的使用方法。2、MATLAB 的 GUI 提供的很多實(shí)用的控件,方便用于設(shè)計(jì)屬于自己的圖形界面。3、Matlab 具有強(qiáng)大、豐富的內(nèi)置函數(shù)和工具箱,界面設(shè)計(jì)時(shí)更加簡(jiǎn)潔、快捷與直觀。5參考文獻(xiàn)MATLAB 語(yǔ)言及其在電子信息工程中的應(yīng)用王洪元主編清華大學(xué)出版社MATLAB 中 GUI 的應(yīng)用王洪元主編清華大學(xué)出版社姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):12084410
18、44121313/2424附錄(主要程序)functionvarargout=untitled66(varargin)%UNTITLED66MATLABcodeforuntitled66.fig%UNTITLED66,byitself,createsanewUNTITLED66orraisestheexisting%singleton*.%H=UNTITLED66returnsthehandletoanewUNTITLED66orthehandleto%theexistingsingleton*.%UNTITLED66(CALLBACK,hObject,eventData,handles,)c
19、allsthelocal%functionnamedCALLBACKinUNTITLED66.Mwiththegiveninputarguments.%UNTITLED66(Property,Value,)createsanewUNTITLED66orraisesthe%existingsingleton*.Startingfromtheleft,propertyvaluepairsare%appliedtotheGUIbeforeuntitled66_OpeningFcngetscalled.An%unrecognizedpropertynameorinvalidvaluemakesprop
20、ertyapplication%stop.Allinputsarepassedtountitled66_OpeningFcnviavarargin.%*SeeGUIOptionsonGUIDEsToolsmenu.ChooseGUIallowsonlyone%instancetorun(singleton).%Seealso:GUIDE,GUIDATA,GUIHANDLES%Edittheabovetexttomodifytheresponsetohelpuntitled66%LastModifiedbyGUIDEv2.509-Dec-201420:42:08%Begininitializat
21、ioncode-DONOTEDITgui_Singleton=1;gui_State=struct(gui_Name,mfilename,.gui_Singleton,gui_Singleton,.gui_OpeningFcn,untitled66_OpeningFcn,gui_OutputFcn,untitled66_OutputFcn,gui_LayoutFcn,口,.gui_Callback,);ifnargin&ischar(varargin1)gui_State.gui_Callback=str2func(varargin1);endifnargoutvarargout1:nargo
22、ut=gui_mainfcn(gui_State,varargin:);1414/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044elsegui_mainfcn(gui_State,varargin:);end%Endinitializationcode-DONOTEDIT%Executesjustbeforeuntitled66ismadevisible.functionuntitled66_OpeningFcn(hObject,eventdata,handles,varargin)%Thisfunctionhasnooutputargs,seeOutputFcn.%
23、hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%varargincommandlineargumentstountitled66(seeVARARGIN)%Choosedefaultcommandlineoutputforuntitled66handles.output=hObject;%Updatehandlesstructureguidata(hObject,handles);%UIWA
24、ITmakesuntitled66waitforuserresponse(seeUIRESUME)%uiwait(handles.figure1);%-Outputsfromthisfunctionarereturnedtothecommandline.functionvarargout=untitled66_OutputFcn(hObject,eventdata,handles)%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);%hObjecthandletofigure%eventdatareserved-tobedefined
25、inafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Getdefaultcommandlineoutputfromhandlesstructurevarargout1=handles.output;functionedit1_Callback(hObject,eventdata,handles)%hObjecthandletoedit1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurew
26、ithhandlesanduserdata(seeGUIDATA)%Hints:get(hObject,String)returnscontentsofedit1astext%str2double(get(hObject,String)returnscontentsofedit1asadouble1515/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044%-Executesduringobjectcreation,aftersettingallproperties.functionedit1_CreateFcn(hObject,eventdata,handles)%hO
27、bjecthandletoedit1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:editcontrolsusuallyhaveawhitebackgroundonWindows.%SeeISPCandCOMPUTER.ifispc&isequal(get(hObject,BackgroundColor),get(0,defaultUicontrolBackgroundColor)se
28、t(hObject,BackgroundColor,white);end%-Executesonbuttonpressinpushbutton1.functionpushbutton1_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)globaljja=get(handles.edit1,if(
29、strcmp(a,0.set(handles.edit1,elseString);尸=1)&(jj=0)String,0.)a=strcat(a,set(handles.edit1,end0)String,a)jj=0%-Executesonbuttonpressinpushbutton2.functionpushbutton2_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton2(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handless
30、tructurewithhandlesanduserdata(seeGUIDATA)String);尸=1)&(jj=0)String,1)1)String,a)1616/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044globaljja=get(handles.edit1,if(strcmp(a,0set(handles.edit1,elsea=strcat(a,set(handles.edit1,endjj=0%-Executesonbuttonpressinpushbutton3.functionpushbutton3_Callback(hObject,event
31、data,handles)%hObjecthandletopushbutton3(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)globaljja=get(handles.edit1,endjj=0%-Executesonbuttonpressinpushbutton4.functionpushbutton4_Callback(hObject,eventdata,handles)%hObjecthandletopus
32、hbutton4(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)globaljjString);尸=1)&(jj=0)String,3)3)String,a)jj=0%-Executesonbuttonpressinpushbutton5.functionpushbutton5_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton5(seeGCBO
33、)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)globaljja=get(handles.edit1,String);if(strcmp(a,0尸=1)&(jj=0)set(handles.edit1,String,4)1717/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044String);if(strcmp(a,set(handles.edit1,else0尸=1)&(jj=0)String,2)a=s
34、trcat(a,set(handles.edit1,2)String,a)a=get(handles.edit1,if(strcmp(a,0set(handles.edit1,elsea=strcat(a,set(handles.edit1,endelsea=strcat(a,4)set(handles.edit1,String,a)endjj=0%-Executesonbuttonpressinpushbutton6.functionpushbutton6_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton6(seeGC
35、BO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)globaljjString);尸=1)&(jj=0)String,5)5)String,a)jj=0%-Executesonbuttonpressinpushbutton7.functionpushbutton7_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton7(seeGCBO)%eventdatares
36、erved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)String);尸=1)&(jj=0)String,6)6)String,a)endjj=0%-Executesonbuttonpressinpushbutton8.functionpushbutton8_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton8(seeGCBO)%eventdatareserved-tobedefinedinaf
37、utureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)globaljj1818/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044a=get(handles.edit1,if(strcmp(a,0set(handles.edit1,elsea=strcat(a,set(handles.edit1,endglobaljja=get(handles.edit1,if(strcmp(a,0set(handles.edit1,elsea=strcat(a,set(handles.edit1,姓
38、名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044a=get(handles.edit1,if(strcmp(a,0set(handles.edit1,elsea=strcat(a,set(handles.edit1,endjj=0String);尸=1)&(jj=0)String,7)7)String,a)%-Executesonbuttonpressinpushbutton9.functionpushbutton9_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton9(seeGCBO)%eventdatar
39、eserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)globaljja=get(handles.edit1,if(strcmp(a,0set(handles.edit1,elsea=strcat(a,set(handles.edit1,endString);尸=1)&(jj=0)String,8)8)String,a)jj=0%-Executesonbuttonpressinpushbutton10.functionpushbutton10_Callback(
40、hObject,eventdata,handles)%hObjecthandletopushbutton10(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)globaljja=get(handles.edit1,if(strcmp(a,0set(handles.edit1,elsea=strcat(a,set(handles.edit1,String);尸=1)&(jj=0)String,9)9)String,a)e
41、ndjj=0%-Executesonbuttonpressinpushbutton11.functionpushbutton11_Callback(hObject,eventdata,handles)1919/2424%hObjecthandletopushbuttonll(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)globaljjglobalja=get(handles.edit1,String)a=strca
42、t(a,+)if(jj=0)set(handles.edit1,String,a)jj=1;endj=0;%-Executesonbuttonpressinpushbutton12.functionpushbutton12_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton12(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)globaljjglo
43、balja=get(handles.edit1,String)a=strcat(a,-)if(jj=0)set(handles.edit1,String,a)jj=1;endj=0;%-Executesonbuttonpressinpushbutton13.functionpushbutton13_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton13(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhan
44、dlesanduserdata(seeGUIDATA)globaljjglobalja=get(handles.edit1,String)a=strcat(a,*)if(jj=0)set(handles.edit1,String,a)jj=1;endj=0;2020/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044%-Executesonbuttonpressinpushbutton14.functionpushbutton14_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton14(seeGCBO
45、)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)globaljjglobalja=get(handles.edit1,String)a=strcat(a,/)if(jj=0)set(handles.edit1,String,a)jj=1;endj=0;%-Executesonbuttonpressinpushbutton15.functionpushbutton15_Callback(hObject,eventdata,handle
46、s)%hObjecthandletopushbutton15(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)globaljjglobalja=get(handles.edit1,String)a=strcat(a,.)if(jj=0)set(handles.edit1,String,a)jj=1;endj=0;%-Executesonbuttonpressinpushbutton16.functionpushbutt
47、on16_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton16(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)a=get(handles.edit1,String)b=eval(a)set(handles.edit1,String,num2str(bA2)2121/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044%-Ex
48、ecutesonbuttonpressinpushbutton17.functionpushbutton17_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton17(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)a=get(handles.edit1,String);b=eval(a)b=b*pi/180;b=sin(b);set(handles
49、.edit1,String,b)%-Executesonbuttonpressinpushbutton18.functionpushbutton18_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton18(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)a=get(handles.edit1,String);b=eval(a)b=b*pi/180;
50、b=cos(b);set(handles.edit1,String,b)%-Executesonbuttonpressinpushbutton19.functionpushbutton19_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton19(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)a=get(handles.edit1,b=eval(a
51、)if(mod(b,90)=0)b=b*pi/180;b=tan(b);set(handles.edit1,elseset(handles.edit1,end%-Executesonbuttonpressinpushbutton20.functionpushbutton20_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton20(seeGCBO)2222/2424姓名:曹慈航班級(jí):12級(jí)電氣自動(dòng)化2班學(xué)號(hào):1208441044String);String,b)String,error:?)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)String);String,b)String,error)end%-Executesonbuttonpressinpushbutton21.functionpushbutton21_Callback(hObject,eventdata,handles)%hObje
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 圖書講座系列策劃方案計(jì)劃
- 班級(jí)工作計(jì)劃順利推進(jìn)
- 2025年離合器主缸項(xiàng)目合作計(jì)劃書
- 2025年高密度聚乙烯土工膜合作協(xié)議書
- 綠色建筑項(xiàng)目2024年合作意向書
- 金融科技公司風(fēng)控系統(tǒng)設(shè)計(jì)與優(yōu)化措施研究報(bào)告
- 消防維修工程合同協(xié)議書
- 房地產(chǎn)營(yíng)銷合作項(xiàng)目協(xié)議書
- 工業(yè)機(jī)器人班級(jí)文化建設(shè)方案設(shè)計(jì)
- 季度市場(chǎng)營(yíng)銷工作計(jì)劃與執(zhí)行步驟
- 中考數(shù)學(xué)第一輪復(fù)習(xí)經(jīng)典課件
- 《安全原理》習(xí)題庫(kù)及參考答案
- 分離工程授課教案
- 《HSK標(biāo)準(zhǔn)教程3》第10課
- 中醫(yī)康復(fù)治療技術(shù)復(fù)習(xí)試題及答案
- 屈光手術(shù)分類
- 系統(tǒng)上線驗(yàn)收合格證書
- ABO血型鑒定及交叉配血
- 【重慶長(zhǎng)安汽車公司績(jī)效管理現(xiàn)狀、問(wèn)題及優(yōu)化對(duì)策(7600字論文)】
- 計(jì)算機(jī)網(wǎng)絡(luò)畢業(yè)論文3000字
- 孔軸的極限偏差表
評(píng)論
0/150
提交評(píng)論