matlab课程设计.doc_第1页
matlab课程设计.doc_第2页
matlab课程设计.doc_第3页
matlab课程设计.doc_第4页
matlab课程设计.doc_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

目录摘要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摘要与数值计算和符号计算相比,图形的可视化技术是数学计算人员所追求的更高级的一种技术,因为对于数值计算和符号计算来说,不管计算的结果是多么的准确,人们往往无法直接从大量的数据和符号中体会它们的具体含义。而图形处理技术则给人们提供了一种更直接的表达方式,可以使人们更直接、更清楚地了解事物的结果和本质。matlab语言除了有强大的矩阵处理功能之外,它的绘图功能也是相当强大的。matlab语言提供了一套功能强大的绘图命令,这些命令可以根据输入的数据自动完成图形的绘制,为计算过程和结果的可视化提供了极佳的手段。1 设计任务与要求1.1 设计任务 用界面实现各种图形绘制1.2 设计要求 主界面包含控制背景颜色与图形坐标的菜单;界面中包含一些按钮控件以实现一些常用的二维与三维图形显示。要求实现圆,球面,圆柱面,以及二次曲线的画法。并对坐标和曲线加上标注。令做一个编辑控件实现用户要描述任意图形,用一按钮控件实现绘制。2 软件介绍2.1 matlab简介matlab俗称“矩阵实验室”,是matrix laboratory的缩写。1984年由美国mathworks公司研制开发,以矩阵计算为基础的交互式的功能强大的科学及工程计算软件。首创者是在数值线性代数领域颇有影响的cleve moler博士。他也是生产经营matlab产品的mathworks公司的创始人之一。 matlab将高性能的数值计算和可视化集成在一块,并提供了大量的内置函数,从而使其广泛应用于数学计算和分析、自动控制、系统仿真、数字信号处理、图形图像分析、数理统计、人工智能、虚拟现实技术、通讯工程、金融系统等领域。时至今日,经过mathworks公司的不断完善,matlab已经发展成为适合多学科、多种工作平台的功能强大的大型软件。在国外,matlab已经经受了多年考验。在欧美等高校,matlab已经成为线性代数,自动控制理论,数理统计,数字信号处理,时间序列分析,动态系统仿真等高级课程的基本教学工具;成为攻读学位的大学生,硕士生,博士生必须掌握的基本技能。在设计研究单位和工业部门,matlab被广泛用于科学研究和解决各种具体问题。在国内,特别是工程界,matlab一定会盛行起来。可以说,无论你从事工程方面的哪个学科,都能在matlab里找到合适的功能。因此,matlab是面向21世纪的计算机程序设计及科学计算语言。 启动matlab后,进入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编辑控件和按钮控件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,.) 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 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 text 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, , . 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 xjq_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 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_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 handles 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 (see 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 user 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 (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 reserved - 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;plot(x,y);title(二次曲线)% - executes on button press in pushbutton5.function pushbutton5_callback(hobject, eventdata, handles)% hobject handle to pushbutton5 (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 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 during 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 usually 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 reserved - to be defined in a future version of matlab% handles structure with handles and user data (see guidata)% -function untitled_4_callback(hobject, eventdata, handle

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论