您好,欢迎访问三七文档
当前位置:首页 > 办公文档 > 其它办公文档 > matlab-简明实例教程
1MATLAB2MATLABMALABMATrixLABoratoryLINPACKEISPACKMATLABAx=bMATLABA*x=bA,bxx=A\bMATLABCFortranMATLABMATLABtoolboxMATLABControlToolbox(SignalProcessingToolbox)(CommunicationToolbox)MATLABMATLABMATLABMATLABMATLABMATLAB2.1MATLABMATLABquitMATLABclcMATLABclfMATLABclearpackdircddisptypeecho3holdMATLABMATLAB51302+).sin(π2*sin(0.3*pi)/(1+sqrt(5))[Enter],ans=0.5000↑Home↓End←Delete→BackspacePageUpEscPageDown2.2MATLABMATLAB[][1]A=[1,2,3;4,5,6;7,8,9;10,11,12]A=123456789101112AMATLABWorkspaceclearMATLAB[2]A=[123456780123]A=1234567840123[3]B(1,2)=3;B(4,4)=6;B(4,2)=11B=030000000000011062.3MATLABMATLABMATLAB12=12ansans34=+*519MATLAB[1]2001/81ans=24.7037[2]s=1-1/2+1/3-1/4+1/5-1/6+1/7-1/8;ssss=0.63452.4WhoWhosWhoWhosMATLABWhos[1]whowhoYourvariablesare:s[2]whoswhosNameSizeBytesClasss1x18doublearrayGrandtotalis1elementsusing8bytes5MATLABPermanentvariablesPredefinedvariablesepspc522−piπ3.14159265358979infInfNaNi,j1−==jiflops1MATLAB2clear3clear[1]s=1/0Warning:Dividebyzero.s=Infa=Inf/infa=NaN2.5MATLAB3-990.00139.24451541.2434e-64.673e33IEEEeps16308308101101××−~+*/\^[1]x=2*pi/3+2^3/5-0.3e-3x=3.69412.6MATLABij6[1]z1=3+4*i,z2=2*exp(i*pi/6)z=z1*z2z1=3.0000+4.0000iz2=1.7321+1.0000iz=1.1962+9.9282i[2]A=[1,3;2,4]-i*[5,8;6,9]B=[1+5*i,2+6*i;3+8*i,4+9*i]C=A*BA=1.0000-5.0000i3.0000-8.0000i2.0000-6.0000i4.0000-9.0000iB=1.0000+5.0000i2.0000+6.0000i3.0000+8.0000i4.0000+9.0000iC=1.0e+002*0.99001.1600-0.0900i1.1600+0.0900i1.37002.7MATLAB12M3MATLABzzzzzzzzzzz[]z=1233.344x=sqrt(log(z))z=71.233344000000000e+003x=2.667861401680282.8MATLABshortMATLABformatMATLABshort5[]x=[4/31.2345e-6]shortx=1.33330.0000formatshortexx=1.3333e+0001.2345e-006formatlongxx=1.333333333333330.00000123450000formatlongexx=1.333333333333333e+0001.234500000000000e-006formatbankxx=1.330.00formathexxx=3ff55555555555553eb4b6231abfd271format+++xx=++formatcompact()2.9quitexitMATLABMATLAB81savematlab.mat2save[][]savetempxyzx,y,ztemp.matMATLABload1loadmatlab.matMATLAB2load[][]MATLABloadtempxtemp.matxMATLAB2.10MATLABMATLABMATLAB[1]t=0:pi/50:4*pi;y0=exp(-t/3);y=exp(-t/3).*sin(3*t);plot(t,y,t,y0,t,-y0)grid02468101214-1-0.8-0.6-0.4-0.200.20.40.60.81[2]x=-8:0.5:8;y=x';X=ones(size(y))*x;Y=y*ones(size(x));R=sqrt(X.^2+Y.^2)+eps;Z=sin(R)./R;mesh(Z);colormap([1,0,0])92.11lplookforMATLAB1MATLABhelpwindows2MATLAB(i)helpMATLABhelpHELPtopics:matlab\general-Generalpurposecommands.matlab\ops-Operatorsandspecialcharacters.matlab\lang-Programminglanguageconstructs.matlab\elmat-Elementarymatricesandmatrixmanipulation.matlab\elfun-Elementarymathfunctions.matlab\specfun-Specializedmathfunctions.matlab\matfun-Matrixfunctions-numericallinearalgebra.matlab\datafun-DataanalysisandFouriertransforms.matlab\polyfun-Interpolationandpolynomials.matlab\funfun-FunctionfunctionsandODEsolvers.matlab\sparfun-Sparsematrices.matlab\graph2d-Twodimensionalgraphs.matlab\graph3d-Threedimensionalgraphs.matlab\specgraph-Specializedgraphs.matlab\graphics-HandleGraphics.matlab\uitools-Graphicaluserinterfacetools.matlab\strfun-Characterstrings.matlab\iofun-Fileinput/output.matlab\timefun-Timeanddates.matlab\datatypes-Datatypesandstructures.matlab\winfun-WindowsOperatingSystemInterfaceFiles(DDE/ActiveX)matlab\demos-Examplesanddemonstrations.toolbox\runtime-MATLABRuntimeServerDevelopmentKitrtw\windows-RealTimeWindowsTarget.10daq\daq-DataAcquisitionToolboxdaq\daqdemos-DataAcquisitionToolbox-DataAcquisitionDemos.toolbox\dials-Dials&GaugesBlocksettoolbox\rptgenext-SimulinkReportGeneratortoolbox\rptgen-MATLABReportGeneratordatabase\database-DatabaseToolbox.database\dbdemos-DatabaseToolboxDemonstrationFunctions.powersys\powerdemo-PowerSystemBlocksetDemos.powersys\powersys-PowerSystemBlocksettoolbox\compiler-MATLABCompiler(andCompiler1.2.1)comm\comm-CommunicationsToolbox.comm\commmasks-CommunicationsToolboxmaskhelperfunctions.comm\commsfun-CommunicationsToolboxS-functions.comm\commsim-CommunicationsToolboxSimulinkfiles.toolbox\symbolic-SymbolicMathToolbox.nag\nag-NAGFoundationToolbox-Numerical&StatisticalLibrarynag\examples-NAGFoundationToolbox-Numerical&StatisticalLibrarymap\map-MappingToolboxmap\mapdisp-MappingToolboxMapDefinitionandDisplay.map\mapproj-MappingToolboxProjections.wavelet\wavelet-WaveletToolbox.wavelet\wavedemo-WaveletToolboxDemos.toolbox\pde-PartialDifferentialEquationToolbox.finance\finance-FinancialToolbox.finance\calendar-FinancialToolboxcalendarfunctions.finance\findemos-FinancialToolboxdemonstrationfunctions.lmi\lmictrl-LMIControlToolbox:ControlApplicationslmi\lmilab-LMIControlToolboxqft\qft-QFTControlDesignToolbox.qft\qftdemos-QFTControlDesignToolboxDemostoolbox\fixpoint-Fixed-PointBlocksetfixpoint\fxpdemos-Fixed-PointBlocksetDemosfixpoint\obsolete-ObsoleteFixed-PointBlocksetdspblks\dspblks-DSPBlockset.dspblks\dspmex-(Notableofcontentsfile)dspblks\dspdemos-DSPBlocksetdemonstrationsandexamples.dspblks\dspmasks-DSPBlocksetmaskhelperfunctions.fuzzy\fuzzy-FuzzyLogicToolbox.fuzzy\fuzdemos-FuzzyLogicToolboxDemos.mpc\mpccmds-ModelPredictiveControlToolbox.mpc\mpcdemos-ModelPredictiveControlToolbox11fdident\fdident-Frequenc
本文标题:matlab-简明实例教程
链接地址:https://www.777doc.com/doc-1358198 .html