matlab課程設(shè)計(jì)匯本(簡(jiǎn)單計(jì)算器的設(shè)計(jì))_第1頁(yè)
matlab課程設(shè)計(jì)匯本(簡(jiǎn)單計(jì)算器的設(shè)計(jì))_第2頁(yè)
matlab課程設(shè)計(jì)匯本(簡(jiǎn)單計(jì)算器的設(shè)計(jì))_第3頁(yè)
已閱讀5頁(yè),還剩7頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(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ì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論