基于VB和MATLAB的控制系统频率特性曲线绘制软件二次开发摘要MATLAB软件开发公司,Mathworks,是一种高性能的语言为技术计算它集计算、可视化和编程在一个易于使用的环境中存在的问题及解决数学符号表达熟悉…因为强大的矩阵运算,叫做矩阵实验室Matlab语言与自然语言是相似的使用Matlab极为方便它也有很多功能,可被称为易但是,也有一些缺点因为MATLAB语言是一种解释执行脚本语言,它是非常缓慢循环语句的执行在同等条件下,与之相比,一些高级语言如VB,VC和执行循环的句子在低速图形用户界面(GUI)的MATLAB不是很亲切,参数输入和输出不方便的.VB中,作为一种高水平的计算机语言,实行循环句子得比较快,和它的GUI是友好的.结合可视化编程接口与强大的功能的VB,MATLAB在数值计算和显示的图形,我们可以利用他们自身的优势,避免他们的弱点。所以本软件采用VB的ActiveX自动化技术ActiveX是一种应用程序开发技术和体系结构的总称[3]。用户可以通过一些小型的,快速的,可重用的组件更加适应商业和家用应用程序的开发;ActiveX代表一种新的应用程序集成开发策略。ActiveX组件有多种类型,VB和Matlab之间通信主要用到自动化服务器和自动化控制器的技术[3]。Matlab作为自动化服务器,被作为自动化控制器的VB程序所调用。为了在VB中请求Matlab的服务,必须获得Matlab对象在系统注册表中定义的名字一般来说,这个名字为“Matlab.Application”。启动服务器后,就可通过Matlab提供的一些接口函数调用Matlab。这些函数不仅可执行任何合法命令,而且可向Matlab传送和获得数据。建立自动化控制器的方式十分简单,在VB开发环境中,首先选择“工程”下的“引用”标签,选中MablabAutomationServerTypeLibrary。然后用ObjectBrowser查看Mlapp,就可看到Matlab作为服务器提供的接口函数。利用了Matlab作为服务器提供的接口函数FunctionExectue(nameAsString)asstring。此函数用于执行一个合法的Matlab命令或者在Matlab的工作空间中调用M文件,并将绘图程序产生的图形显示在屏幕上。输入的name符串可以是Matlab的命令,也可以是调用的M文件名,函数返回一个字符串,然后通过软件开发技术,如:软件设计说明书;软件使用说明书;软件测试分析报告;项目开发总结等过程后完成本软件的开发工程。关键词:GUICOM编程思想ActiveX控件网络资源通信交互方法ActiveX自动化技术MatrixVBAbstractMATLAB®softwaredevelopmentCo.,Mathworks,isahigh-performancelanguagefortechnicalcalculationitsetsthecalculation,visualizationandprogramminginaneasytouseenvironmentalproblemsandsolvingmathematicalsymbolsexpressfamiliar...Becauseofthestrongmatrixcomputation,calledthematrixMatlablanguagelaboratorywiththenaturallanguageissimilartotheuseofMatlabisveryconvenient,italsohasmanyfunctions,canbecalledeasybutitalsohassomedisadvantagesbecauseMatlablanguageisakindofexplanation,itisexecutedscriptinglanguageveryslowimplementationofloopingstatementsincoequalcondition,comparedwithsomehigh-levellanguagessuchasVB,VCandexecutionofthesentenceinthelowcyclegraphicaluserinterface(GUI)isnotveryfriendly,andtheparametersoftheMatlabinputandoutputconvenient.VB,asahighlevelofcomputerlanguagesentencefastercycle,anditisfriendly.CombiningGUIprogramminginterfaceandstrongvisualfunctionofVB,Matlabinnumericalcalculationandgraphicdisplay,wecanusetheirownadvantages,toavoidtheirweaknesses.SothesoftwareusingVBActiveXautomationtechnologyActiveXisakindofapplicationdevelopmenttechnologyandsystemstructureofthefloorboard[3].Userscanthroughsomesmall,fast,reusablecomponentsofcommercialandresidentialmoreadaptabletotheapplicationdevelopment,ActiveXrepresentsanewapplicationintegrationdevelopmentstrategy.TherearemanydifferenttypesofmodulesActiveXVBandMatlabmainlyusedbetweencommunicationserverandautomationcontrollerofautomationtechnology[3].Matlabasautomationserver,knownastheVBprogramautomaticcontroller.MatlabinVBtorequestservice,mustobtainMatlabobjectinthesystemregistrydefinitionnames,generallyspeaking,thenameisMatlabisusedtoapply..AftertheserverthroughMatlab,canprovidesomeoftheinterfacefunctioninvocationMatlab.Thesefunctionnotonlycanperformanylawfulorders,andcanbetransmittedtotheMatlabanddata.EstablishAutomationcontrollerisverysimple,thewayinVBdevelopmentenvironment,thefirstchoiceproject,introductiontagLibraryAutomationServerTypeMablabselected.ThenuseObjectBrowserMlappview,youcanseetheinterfacesprovideaserverMatlab.UseMatlab®forserverprovidesinterfacesExectuehirethoseknowledgeableprogrammersFunctionname(ring)asstringAsSt.ThisfunctionisusedtoexecutealegitimateMatlabordersorinMatlabworkspacecallMfiles,andwillgenerategraphicsdrawingprogramdisplayedonthescreen.InputthenameoftheoperatorcanbeMatlaborders,alsocanbeinvokedtheM()functionreturnsastringfilename,andthenthroughthesoftwaredevelopmenttechniques,suchas:thesoftwaredesignspecifications,Softwareinstructions,Softwaretestinganalysisreport,Projectdevelopmentaftercompletionofthiscoursesummaryofthedevelopmentofsoftwareengineering.Keywords:GUICOMprogrammingActiveXcontrolnetworkresourcethoughtcommunicationinteractivemethodsActiveXMatrixVBautomationtechnology目录第一章VB编程简介...............................................................................................................................61.1VB编程语言历史.............................................................................................................................61.2VB主要用途领域..............................................................................................................................81.3VB的优点............................................................................................................................................8第二章MATLAB使用的简介.............................................................................................................92.1MATLAB的历史..............................................................................................................................92.2MATLAB语言的主要特点.........................................................................................................92.3MATLAB能做什么........................................................................................................................92.4网络资源......................................................................................