


版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、matlab課程設(shè)計(jì)報(bào)告題目 學(xué)院 專(zhuān)業(yè)簡(jiǎn)易計(jì)算器的設(shè)計(jì) 電子信息工程學(xué)院 電子信息學(xué)生和學(xué)號(hào)指導(dǎo)教師i / ii一、選題目的及意義GUI的廣泛應(yīng)用是當(dāng)今計(jì)算機(jī)開(kāi)展的重大成就之一,它極方便了非專(zhuān)業(yè)用戶(hù)的使用。人們從此不再需要死記硬背大量的命令, 取而代之的 是可以通過(guò)窗口、菜單、按鍵等方式來(lái)方便地進(jìn)展操作,而在matlab 有很簡(jiǎn)單的gui設(shè)計(jì)工具,我們可以通過(guò)這個(gè)工具輕松地構(gòu)建我們想 要的程序,從而實(shí)現(xiàn)與用戶(hù)的信息交互。本次課程設(shè)計(jì)是使用了 matlab中的guide生成了簡(jiǎn)單的計(jì)算器程序。、源代碼fun cti on varargout = Calculator(vararg in)%Si
2、mple Calculator %An hui Uni versity% Begin initialization code - DO NOT EDIT gui_S in glet on = 1; gui_State = struct(gui_Name:mfile name,.'gui_S in glet on', gui_S in glet on, 'gui_Ope nin gF; Calculator_Ope nin gF,.'gui_OutputF', Calculator_OutputF,. 'gui_LayoutF',.'
3、;gui_Callback; );if nargin && ischar(varargin1) gui_State.gui_Callback = str2fu nc(varargi n1); endif n argout varargout1:nargout = gui_mainf(gui_State, varargin:); else gui_mai nf(gui_State, varargi n:); end % End initialization code - DO NOT EDIT% - Executes just before Calculator is made
4、visible. fun ctio n Calculator_Ope nin gF(hObject, eve ntdata, han dles, varargi n) % This fun cti on has no output args, see OutputF. % hObject han dle to figure % eve ntdata reserved - to be defi ned in a future vers ion of MATLAB % han dles structure with han dles and user data (see GUIDATA) % va
5、rargin mand line argume nts to Calculator (see VARARGIN)% Choose default mand line output for Calculator han dles.output = hObject;% Update han dles structure guidata(hObject, han dles);% UIWAIT makes Calculator wait for user respo nse (see UIRESUME) % uiwait(ha ndles.figure1);% - Outputs from this
6、function are returned to the mand line, fun ctio n varargout = Calculator_OutputF(hObject, eve ntdata, han dles) % varargout cell array for returni ng output args (see VARARGOUT);% hObject han dle to figure % eve ntdata reserved - to be defi ned in a future vers ion of MATLAB% han dles structure wit
7、h han dles and user data (see GUIDATA)% Get default mand line output from han dles structure varargout1 = han dles.output;% - Executes on butt on press in p1. function p1_Callback(hObject, eventdata, handles)% hObject han dle to p1 (see GCBO) % eve ntdata reserved - to be defi ned in a future vers i
8、on of MATLAB% han dles structure with han dles and user data (see GUIDATA) textstri ng=get(ha ndles.text1,'stri ng'); textstring=strcat(textstring, '1');set(ha ndles.text1,'stri ng' ,textstri ng)% - Executes on butt on press in p2. function p2_Callback(hObject, eventdata, han
9、dles)% hObject han dle to p2 (see GCBO) % eve ntdata reserved - to be defi ned in a future vers ion of MATLAB% han dles structure with han dles and user data (see GUIDATA) textstri ng=get(ha ndles.text1,'stri ng');textstring=strcat(textstring, '2'); set(ha ndles.text1,'stri ng
10、9; ,textstri ng)3 / 11% - Executes on butt on press in p3. fun cti on p3_Callback(hObject, eve ntdata, han dies)% hObject han dle to p3 (see GCBO)% eve ntdata reserved - to be defi ned in a future vers ion of MATLAB % han dies structure with han dies and user data (see GUIDATA) textstri ng=get(ha nd
11、les.text1,'stri ng');textstring=strcat(textstring, 3); set(ha ndles.text1,'stri ng' ,textstri ng)% - Executes on butt on press in p4. function p4_Callback(hObject, eventdata, handles)% hObject han dle to p4 (see GCBO)% eve ntdata reserved - to be defi ned in a future vers ion of MATL
12、AB % han dles structure with han dles and user data (see GUIDATA) textstri ng=get(ha ndles.text1,'stri ng');textstring=strcat(textstring, '4'); set(ha ndles.text1,'stri ng' ,textstri ng)% - Executes on butt on press in p5. function p5_Callback(hObject, eventdata, handles)% hO
13、bject han dle to p5 (see GCBO)% eve ntdata reserved - to be defi ned in a future vers ion of MATLAB % han dles structure with han dles and user data (see GUIDATA) textstri ng=get(ha ndles.text1,'stri ng');textstring=strcat(textstring, '5'); set(ha ndles.text1,'stri ng' ,texts
14、tri ng)% - Executes on butt on press in p6. function p6_Callback(hObject, eventdata, handles)% hObject han dle to p6 (see GCBO)% eve ntdata reserved - to be defi ned in a future vers ion of MATLAB % han dles structure with han dles and user data (see GUIDATA) textstri ng=get(ha ndles.text1,'stri
15、 ng'); textstring=strcat(textstring, '6');set(ha ndles.text1,'stri ng' ,textstri ng)% - Executes on butt on press in p7. function p7_Callback(hObject, eventdata, handles)% hObject han dle to p7 (see GCBO)% eve ntdata reserved - to be defi ned in a future vers ion of MATLAB % han
16、dles structure with han dles and user data (see GUIDATA) textstri ng=get(ha ndles.text1,'stri ng');textstring=strcat(textstring, '7'); set(ha ndles.text1,'stri ng' ,textstri ng)% - Executes on butt on press in p8.fun cti on p8_Callback(hObject, eve ntdata, han dies)% hObject
17、han dle to p8 (see GCBO) % eve ntdata reserved - to be defi ned in a future vers ion of MATLAB % han dies structure with han dies and user data (see GUIDATA) textstri ng=get(ha ndles.text1,'stri ng'); textstring=strcat(textstring, '8');set(ha ndles.text1,'stri ng' ,textstri n
18、g)% - Executes on butt on press in p9. function p9_Callback(hObject, eventdata, handles) % hObject han dle to p9 (see GCBO) % eve ntdata reserved - to be defi ned in a future vers ion of MATLAB % han dles structure with han dles and user data (see GUIDATA) textstri ng=get(ha ndles.text1,'stri ng
19、'); textstring=strcat(textstring, 9);set(ha ndles.text1,'stri ng' ,textstri ng)% - Executes on butt on press in add. function add_Callback(hObject, eventdata, handles) % hObject han dle to add (see GCBO) % eve ntdata reserved - to be defi ned in a future vers ion of MATLAB % han dles str
20、ucture with han dles and user data (see GUIDATA) textstri ng=get(ha ndles.text1,'stri ng'); textstring=strcat(textstring,'+');set(ha ndles.text1,'stri ng' ,textstri ng)% - Executes on butt on press in p0. function pO_Callback(hObject, eventdata, handles) % hObject han dle to
21、pO (see GCBO) % eve ntdata reserved - to be defi ned in a future vers ion of MATLAB % han dles structure with han dles and user data (see GUIDATA) textstri ng=get(ha ndles.text1,'stri ng'); textstring=strcat(textstring, '0'); set(ha ndles.text1,'stri ng' ,textstri ng)% - Exec
22、utes on butt on press in sub. fun cti on sub_Callback(hObject, eve ntdata, han dles) % hObject handle to sub (see GCBO) % eve ntdata reserved - to be defi ned in a future vers ion of MATLAB % han dles structure with han dles and user data (see GUIDATA) textstri ng=get(ha ndles.text1,'stri ng'
23、;); textstring=strcat(textstring,'-'); set(ha ndles.text1,'stri ng' ,textstri ng)% - Executes on butt on press in div.5 / 11fun ctio n div_Callback(hObject, eve ntdata, han dies)% hObject handle to div (see GCBO) % eve ntdata reserved - to be defi ned in a future vers ion of MATLAB %
24、 han dles structure with han dles and user data (see GUIDATA) textstri ng=get(ha ndles.text1,'stri ng'); textstring=strcat(textstring,'/'); set(ha ndles.text1,'stri ng' ,textstri ng)% - Executes on butt on press in mul.function mul_Callback(hObject, eventdata, handles)% hObje
25、ct han dle to mul (see GCBO)% eve ntdata reserved - to be defi ned in a future vers ion of MATLAB % han dles structure with han dles and user data (see GUIDATA) textstri ng=get(ha ndles.text1,'stri ng'); textstring=strcat(textstring, '*'); set(ha ndles.text1,'stri ng' ,textst
26、ri ng)% - Executes on butt on press in den ghao. fun cti on den ghao_Callback(hObject, eve ntdata, han dles) % hObject han dle to den ghao (see GCBO) % eve ntdata reserved - to be defi ned in a future vers ion of MATLAB% han dles structure with han dles and user data (see GUIDATA) textstri ng=get(ha
27、 ndles.text1,'stri ng'); textstrin g=eval(textstri ng); set(ha ndles.text1,'stri ng' ,textstri ng)% - Executes on butt on press in clear. function clear_Callback(hObject, eventdata, handles)% hObject handle to clear (see GCBO) % eve ntdata reserved - to be defi ned in a future vers i
28、on of MATLAB% han dles structure with han dles and user data (see GUIDATA)set(ha ndles.text1,'stri ng' ,'0')%fun ctio n exit_Callback(hObject, eve ntdata, han dles)% hObject handle to exit (see GCBO) % eve ntdata reserved - to be defi ned in a future vers ion of MATLAB% han dles structure with han dles and user data (see GUIDATA) close(gcf)%fun cti on calculate_Callback(hObject, eve ntdata, han dies) % hObj
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 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ì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025安置房買(mǎi)賣(mài)合同書(shū)樣本
- 2025船舶維修改造合同
- 購(gòu)買(mǎi)牛犢的合同范本
- 學(xué)生安全協(xié)議合同范本
- 技術(shù)保密合同協(xié)議指南
- 公寓租房正規(guī)合同范本
- 糧食代烘干合同范本
- 無(wú)紡購(gòu)銷(xiāo)合同范本
- 冷庫(kù)的維修合同范本
- 鋪?zhàn)夂?jiǎn)單合同范本
- 2025年度跨境電商平臺(tái)總經(jīng)理聘用合同
- 2025年吉林鐵道職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)技能測(cè)試題庫(kù)必考題
- 2025屆湖南省長(zhǎng)沙市長(zhǎng)郡二十校聯(lián)盟高三第二次預(yù)熱演練語(yǔ)文試題
- 《經(jīng)絡(luò)與腧穴》課件-手太陰肺經(jīng)
- 人教版(2024)七年級(jí)下冊(cè)英語(yǔ)期中復(fù)習(xí):Unit1~4+期中共5套學(xué)情調(diào)研檢測(cè)試卷(含答案)
- 中考化學(xué)主題復(fù)習(xí)(重慶)專(zhuān)題4綜合實(shí)驗(yàn)的探究
- 專(zhuān)題01 富強(qiáng)與創(chuàng)新【考情透視+框架梳理+考點(diǎn)突破+題型歸納】道德與法治上學(xué)期期末高效復(fù)習(xí)資料
- 人力資源管理軟件采購(gòu)協(xié)議
- 2025年南京市事業(yè)單位招聘708人歷年管理單位筆試遴選500模擬題附帶答案詳解
- 電動(dòng)汽車(chē)充電樁項(xiàng)目投資商業(yè)計(jì)劃書(shū)范本
- 西安市新建住宅供配電設(shè)施建設(shè)技術(shù)導(dǎo)則.修訂完整版
評(píng)論
0/150
提交評(píng)論