matlab课程设计.doc

上传人:土8路 文档编号:10084202 上传时间:2021-04-18 格式:DOC 页数:13 大小:4.50MB
返回 下载 相关 举报
matlab课程设计.doc_第1页
第1页 / 共13页
matlab课程设计.doc_第2页
第2页 / 共13页
matlab课程设计.doc_第3页
第3页 / 共13页
matlab课程设计.doc_第4页
第4页 / 共13页
matlab课程设计.doc_第5页
第5页 / 共13页
点击查看更多>>
资源描述

《matlab课程设计.doc》由会员分享,可在线阅读,更多相关《matlab课程设计.doc(13页珍藏版)》请在三一文库上搜索。

1、 目录摘要21 设计任务与要求21.1 设计任务21.2 设计要求22 软件介绍32.1 Matlab简介33 Matlab绘图43.1主界面包含控制背景颜色与图形坐标的菜单43.2 图形的实现43.2.1 圆53.2.2 圆柱面53.2.3 球面63.2.3 二次曲线63.3 编辑控件和按钮控件63.4 实现用户要描述的图形73.5 课程设计实验代码74 心得体会125 参考文献12摘要与数值计算和符号计算相比,图形的可视化技术是数学计算人员所追求的更高级的一种技术,因为对于数值计算和符号计算来说,不管计算的结果是多么的准确,人们往往无法直接从大量的数据和符号中体会它们的具体含义。而图形处理

2、技术则给人们提供了一种更直接的表达方式,可以使人们更直接、更清楚地了解事物的结果和本质。MATLAB语言除了有强大的矩阵处理功能之外,它的绘图功能也是相当强大的。MATLAB语言提供了一套功能强大的绘图命令,这些命令可以根据输入的数据自动完成图形的绘制,为计算过程和结果的可视化提供了极佳的手段。1 设计任务与要求1.1 设计任务 用界面实现各种图形绘制1.2 设计要求 主界面包含控制背景颜色与图形坐标的菜单;界面中包含一些按钮控件以实现一些常用的二维与三维图形显示。要求实现圆,球面,圆柱面,以及二次曲线的画法。并对坐标和曲线加上标注。令做一个编辑控件实现用户要描述任意图形,用一按钮控件实现绘制

3、。2 软件介绍2.1 Matlab简介Matlab俗称“矩阵实验室”,是Matrix Laboratory的缩写。1984年由美国MathWorks公司研制开发,以矩阵计算为基础的交互式的功能强大的科学及工程计算软件。首创者是在数值线性代数领域颇有影响的Cleve Moler博士。他也是生产经营Matlab产品的MathWorks公司的创始人之一。 Matlab将高性能的数值计算和可视化集成在一块,并提供了大量的内置函数,从而使其广泛应用于数学计算和分析、自动控制、系统仿真、数字信号处理、图形图像分析、数理统计、人工智能、虚拟现实技术、通讯工程、金融系统等领域。时至今日,经过MathWorks

4、公司的不断完善,Matlab已经发展成为适合多学科、多种工作平台的功能强大的大型软件。在国外,Matlab已经经受了多年考验。在欧美等高校,Matlab已经成为线性代数,自动控制理论,数理统计,数字信号处理,时间序列分析,动态系统仿真等高级课程的基本教学工具;成为攻读学位的大学生,硕士生,博士生必须掌握的基本技能。在设计研究单位和工业部门,Matlab被广泛用于科学研究和解决各种具体问题。在国内,特别是工程界,Matlab一定会盛行起来。可以说,无论你从事工程方面的哪个学科,都能在Matlab里找到合适的功能。因此,Matlab是面向21世纪的计算机程序设计及科学计算语言。 启动Matlab后

5、,进入Matlab的默认桌面(如上图)。第一行为菜单栏,第二行为工具栏,下面是三个最常用的窗口。右边最大的是命令窗口(Command Window),左上方前台为工作空间窗口(workspace),后台为当前目录窗口(Current Dircstory),左下方为命令历史窗口(Command History)。左下角还有一个开始(Start)按钮,用于快速启动各类交互界面、桌面工具和帮助等。3 Matlab绘图3.1主界面包含控制背景颜色与图形坐标的菜单通过书本233页菜单编辑器的学习实现 3.2 图形的实现3.2.1圆 3.2.2 圆柱面3.2.3球面3.2.4二次曲线3.3编辑控件和按钮控

6、件3.4 实现用户要描述的图形这里以实现x.3+x.2+x 为例3.5 课程设计实验代码function varargout = xjq(varargin)% XJQ M-file for xjq.fig% XJQ, by itself, creates a new XJQ or raises the existing% singleton*.% H = XJQ returns the handle to a new XJQ or the handle to% the existing singleton*.% XJQ(CALLBACK,hObject,eventData,handles,.)

7、 calls the local% function named CALLBACK in XJQ.M with the given input arguments.% XJQ(Property,Value,.) creates a new XJQ or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before xjq_OpeningFunction gets called. An% unrecognized property name

8、or invalid value makes property application% stop. All inputs are passed to xjq_OpeningFcn via varargin.% *See GUI Options on GUIDEs Tools menu. Choose GUI allows only one% instance to run (singleton).% See also: GUIDE, GUIDATA, GUIHANDLES% Copyright 2002-2003 The MathWorks, Inc.% Edit the above tex

9、t to modify the response to help xjq% Last Modified by GUIDE v2.5 29-Jun-2011 11:31:49% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_Singleton, . gui_OpeningFcn, xjq_OpeningFcn, . gui_OutputFcn, xjq_OutputFcn, . gui_LayoutFcn,

10、, . gui_Callback, );if nargin & ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);endif nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varargin:);end% End initialization code - DO NOT EDIT% - Executes just before xjq is made visible.function x

11、jq_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to xjq (see

12、VARARGIN)% Choose default command line output for xjqhandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes xjq wait for user response (see UIRESUME)% uiwait(handles.figure1);% - Outputs from this function are returned to the command line.function varargout = xjq

13、_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Get default command line output from hand

14、les structurevarargout1 = handles.output;% - Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)% hObject handle to pushbutton1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (s

15、ee GUIDATA)x=0:0.01:2*pi;y=exp(x*i);plot(y);title(圆)% - Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and u

16、ser data (see GUIDATA)sphere(15);title(球面)% - Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)% hObject handle to pushbutton3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (

17、see GUIDATA)t=0:pi/20:2*pi;x=(sin(t)+1)*5;y=cos(t)*5;z=linspace(0,5,length(t);X=meshgrid(x);Y=meshgrid(y);Z=meshgrid(z);surf(X,Y,Z);title(圆柱面)% - Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles)% hObject handle to pushbutton4 (see GCBO)% eventdata re

18、served - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)x=0:0.01:10;y=-x.2+3*x-6;待添加的隐藏文字内容3plot(x,y);title(二次曲线)% - Executes on button press in pushbutton5.function pushbutton5_Callback(hObject, eventdata, handles)% hObject handle to pushbutto

19、n5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)h=get(handles.edit1,string);y=inline(h);x=0:0.01:10;f=y(x);plot(x,f);xlabel(x),ylabel(y);title(绘图曲线)function edit1_Callback(hObject, eventdata, handles)% hObject

20、 handle to edit1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,String) returns contents of edit1 as text% str2double(get(hObject,String) returns contents of edit1 as a double% - Executes du

21、ring object creation, after setting all properties.function edit1_CreateFcn(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls u

22、sually have a white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,BackgroundColor,white);else set(hObject,BackgroundColor,get(0,defaultUicontrolBackgroundColor);end% -function Untitled_1_Callback(hObject, eventdata, handles)% hObject handle to Untitled_1 (see GCBO)% eventdata res

23、erved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% -function Untitled_4_Callback(hObject, eventdata, handles)% hObject handle to Untitled_4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure wi

24、th handles and user data (see GUIDATA)4 心得体会 这次的课程设计主要是让我们学习使用MATLAB,利用对图像的处理来学习MATLAB这个软件。首先我认识了MATLAB这个软件,其功能非常的强大,由总包和若干个工具箱组成,可以实现数值分析、自动控制、图像处理、神经元网络等若干个领域的计算和图形显示,它将这些不同领域的计算用函数的形式分类成对用户完全透明的库函数,构成一个个针对专门领域的工具箱。使得我们在使用的时候用户直接调用这些库函数并赋予实际参数就能解决实际问题,具有极高的变成效率。我觉得通过这次课设之后,我发现MATLAB强大的功能。不仅仅局限于我们分

25、析信号与系统的时候用到的那些功能,还有其他更多更广泛的用途。5 参考文献【1】 刘慧颖主编,MATLAB R2007基础教程,清华大学出版社,2005.8【2】 陈怀琛主编,数字信号处理教程-MATLAB释义与实现(第二版),电子工业出版社,2007.9【3】 刘卫国主编,MATLAB程序设计教程,中国水利水电出版社,2004.6【4】 李文锋主编,图形图像处理与应用,中国标准出版社,2006.6【5】 朱秀昌主编,数字图像处理与图像通信,北京邮电大学出版社,2002【6】 刘文耀主编,数字图像采集与处理,电子工业出版社,2007.8【7】 王洪元主编,MATLAB语言以及在电子信息工程中的应用,清华大学出版社,2004.12

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1