河北大学工商学院MATLAB GUI在土木工程软件界面设计中的应用论文

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

2013级MATALAB课程结课论文MATLABGUI在土木工程软件界面设计中的应用专业土木工程班级姓名学号2015年12月31日第1页关键词:MATLAB、GUI、土木工程软件摘要图形用户界面(GraphicalUserInterface,简称GUI,又称图形用户接口)是指采用图形方式显示的计算机操作用户界面。与早期计算机使用的命令行界面相比,图形界面对于用户来说在视觉上更易于接受。它的广泛应用是当今计算机发展的重大成就之一,更重要的是它更方便了非专业用户的使用,跳过了人们死记硬背大量命令的环节,取而代之的是通过窗口、菜单、按键等方式来方便的进行操作。在土木工程领域中,许多地方都用到了大量繁琐的计算和绘图,除了CAD等绘图软件外,MATLAB在繁琐的计算和分析数据上给人们提供了方便,本文主要讲的是用MATLAB实现多项式的拟合功能。概述在实际工程应用中,经常需要寻求两个或多个变量间的关系,而实际上一般只能通过观测得到一些离散的数据点,为了从这些数据中找到其内在的规律性,即求得自变量和因变量之间吻合程度比较好的函数关系式,这类问题可以归结为曲线拟合。MATLAB提供了许多线性和非线性拟合方法,有多项式拟合,函数线性组合的曲线拟合,非线性组合的曲线拟第2页合,非线性最小二乘拟合。在这里主要讲一下多项式拟合。可根据实验给出的数据,通过NATLAB多项式拟合得到曲线拟合的图像,结合荷载和变形对建筑物进行分析,以保障建筑物的安全。程序功能介绍文章通过MATLAB进行多项式拟合,和其他汇编语言相比,实现起来比较方便,在变形监测分析中有着很广泛的应用。但是不同建筑物的荷载情况存在差异,文中曲线拟合的运用可能有一定的局限性,仍需要大量的实例进行验证。这只是一个初步的探讨,如能将更多影响变形的因素纳入模型并获得大范围的应用,定期重复观测次数也足够多,可能会获得较好的拟合度,从而得到最佳的预测效果。程序相关代码functionvarargout=guidemo(varargin)%GUIDEMOM-fileforguidemo.fig%GUIDEMO,byitself,createsanewGUIDEMOorraisestheexisting%singleton*.%%H=GUIDEMOreturnsthehandletoanewGUIDEMOorthehandleto%theexistingsingleton*.%%GUIDEMO('CALLBACK',hObject,eventData,handles,...)callsthelocal%functionnamedCALLBACKinGUIDEMO.Mwiththegiveninputarguments.%第3页%GUIDEMO('Property','Value',...)createsanewGUIDEMOorraisesthe%existingsingleton*.Startingfromtheleft,propertyvaluepairsare%appliedtotheGUIbeforeguidemo_OpeningFunctiongetscalled.An%unrecognizedpropertynameorinvalidvaluemakespropertyapplication%stop.Allinputsarepassedtoguidemo_OpeningFcnviavarargin.%%*SeeGUIOptionsonGUIDE'sToolsmenu.ChooseGUIallowsonlyone%instancetorun(singleton).%%Seealso:GUIDE,GUIDATA,GUIHANDLES%Edittheabovetexttomodifytheresponsetohelpguidemo%LastModifiedbyGUIDEv2.512-Dec-201510:05:27%Begininitializationcode-DONOTEDITgui_Singleton=1;gui_State=struct('gui_Name',mfilename,...'gui_Singleton',gui_Singleton,...'gui_OpeningFcn',@guidemo_OpeningFcn,...'gui_OutputFcn',@guidemo_OutputFcn,...'gui_LayoutFcn',[],...'gui_Callback',[]);ifnargin&&ischar(varargin{1})gui_State.gui_Callback=str2func(varargin{1});endifnargout[varargout{1:nargout}]=gui_mainfcn(gui_State,varargin{:});elsegui_mainfcn(gui_State,varargin{:});end%Endinitializationcode-DONOTEDIT%---Executesjustbeforeguidemoismadevisible.functionguidemo_OpeningFcn(hObject,eventdata,handles,varargin)%Thisfunctionhasnooutputargs,seeOutputFcn.第4页%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%varargincommandlineargumentstoguidemo(seeVARARGIN)handles.peaks=peaks(35);handles.membrane=membrane;[x,y]=meshgrid(-8:.5:8);r=sqrt(x.^2+y.^2)+eps;sinc=sin(r)./r;handles.sinc=sinc;handles.current_data=handles.peaks;surf(handles.current_data)%Choosedefaultcommandlineoutputforguidemohandles.output=hObject;%Updatehandlesstructureguidata(hObject,handles);%UIWAITmakesguidemowaitforuserresponse(seeUIRESUME)%uiwait(handles.figure1);%---Outputsfromthisfunctionarereturnedtothecommandline.functionvarargout=guidemo_OutputFcn(hObject,eventdata,handles)%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Getdefaultcommandlineoutputfromhandlesstructurevarargout{1}=handles.output;%---ExecutesonbuttonpressinMesh.functionMesh_Callback(hObject,eventdata,handles)%hObjecthandletoMesh(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)mesh(handles.current_data);%---ExecutesonbuttonpressinSurf.functionSurf_Callback(hObject,eventdata,handles)%hObjecthandletoSurf(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB第5页%handlesstructurewithhandlesanduserdata(seeGUIDATA)surf(handles.current_data);%---ExecutesonbuttonpressinContour3.functionContour3_Callback(hObject,eventdata,handles)%hObjecthandletoContour3(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)contour3(handles.current_data);%---ExecutesonselectionchangeinChooseFun.functionChooseFun_Callback(hObject,eventdata,handles)%hObjecthandletoChooseFun(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)val=get(hObject,'Value');str=get(hObject,'String');switchstr{val};case'peaks'%Userselectspeakshandles.current_data=handles.peaks;case'membrane'%Userselectsmembranehandles.current_data=handles.membrane;case'sinc'%Userselectssinchandles.current_data=handles.sinc;endguidata(hObject,handles)%Hints:contents=get(hObject,'String')returnsChooseFuncontentsascellarray%contents{get(hObject,'Value')}returnsselecteditemfromChooseFun%---Executesduringobjectcreation,aftersettingallproperties.functionChooseFun_CreateFcn(hObject,eventdata,handles)%hObjecthandletoChooseFun(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:popupmenucontrolsusuallyhaveawhitebackgroundonWindows.%SeeISPCandCOMPUTER.ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicon

1 / 8
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功