资源描述:
《实验1matlab软件环境的基本使用》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实验1Matlab的基本运算(1)实验目的:1、了解Matlab的发展和主要功能;2、熟悉MatlabI作环境的各个窗口;3、掌握建立矩阵的方法;4、掌握Matlab各种表达式的书写规则以及常用函数的使用。实验内容:1.在命令窗口依次输入下列命令,根据执行结果分析其功能:helplookforinvhelpinvwhichinv2.建立自己的工作目录,再将自己的工作目录设置到Matlab搜索路径下。用help命令查询自己的工作目录;addpathdyWarning:Nameisnonexistentornot
2、adirectory:dy.>Inpathat115Inaddpathat95»mkdirdy»dirdy1.利用Matlab的帮助功能,分别查询inv、plot、max>round等函数的功能及用法;helpinvINVMatrixinverse.INV(X)istheinverseofthesquarematrixX.AwarningmessageisprintedifXisbadlyscaledornearlysingula匚Seealsoslash,pinv,cond,condest,lsqnonne
3、g,lscov.Overloadedfunctionsormethods(oneswiththesamenameinotherdirectories)helpgf/inv.mhelpfrd/inv.mhelplti/inv.mhelpss/inv.mhelptf/inv.mhelpzpk/inv.mhelpsym/inv.mhelpidmodel/inv.mRefereneepageinHelpbrowserdocinvhelpplotPLOTLinearplot.PLOT(X.Y)plotsvectorYv
4、ersusvectorX.IfXorYisamatrix,thenthevectorisplottedversustherowsorcolumnsofthematrix,whicheverlineup.IfXisascalarandYisavector,length(Y)disconnectedpointsareplotted・PLOT(Y)plotsthecolumnsofYversustheirindex.IfYiscomplex,PLOT(Y)isequivalenttoPLOT(real(Y),ima
5、g(Y)).InallotherusesofPLOT,theimaginarypartisignored・Variouslinetypes,plotsymbolsandcolorsmaybeobtainedwithPLOT(X、Y,S)whereSisacharacterstringmadefromoneelementfromanyorallthefollowing3columns:bblue•point-solidggreen0circle:dottedrredXx-markdashdotccyan+plu
6、s—dashedmmagenta*star(none)nolineyyellowssquarekblackddiamondvtriangle(down)Atriangle(up)triangle(right)ppentagramhhexagramForexample,PLOT(X,Y,'c+:‘)plotsacyandottedlinewithaplusateachdatapoint;PLOT(X,Y/bdr)plotsbluediamondateachdatapointbut
7、doesnotdrawanyline.PLOT(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,...)combinestheplotsdefinedbythe(X,Y,S)triples,wheretheX'sandY*sarevectorsormatricesandtheS'sarestrings.Forexample,PLOT(X,Y,y・;X,Y,go‘)plotsthedatatwice,withasolidyellowlineinterpolatinggreencirclesatthedat
8、apoints.ThePLOTcommand,ifnocolorisspecified,makesautomaticuseofthecolorsspecifiedbytheaxesCoIorOrderproperty.ThedefaultColorOrderislistedinthetableaboveforcolorsystemswherethedefaultisblueforoneline,an