Matlab 7, Function References [2007]

4424
MATLAB ® 7 Function Reference: Volume 1 (A-E)

description

MATLAB - Official Documentation Format: PDF Date: September 2007 Revised for 7.5 (Release 2007b)

Transcript of Matlab 7, Function References [2007]

  • 1. MATLAB 7Function Reference: Volume 1 (A-E)

2. How to Contact The MathWorkswww.mathworks.com Webcomp.soft-sys.matlab Newsgroupwww.mathworks.com/contact_TS.html Technical [email protected] Product enhancement [email protected] Bug [email protected] Documentation error [email protected] Order status, license renewals, [email protected] Sales, pricing, and general information508-647-7000 (Phone)508-647-7001 (Fax)The MathWorks, Inc.3 Apple Hill DriveNatick, MA 01760-2098For contact information about worldwide offices, see the MathWorks Web site.MATLAB Function Reference COPYRIGHT 19842007 by The MathWorks, Inc.The software described in this document is furnished under a license agreement. The software may be usedor copied only under the terms of the license agreement. No part of this manual may be photocopied orreproduced in any form without prior written consent from The MathWorks, Inc.FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentationby, for, or through the federal government of the United States. By accepting delivery of the Program orDocumentation, the government hereby agrees that this software or documentation qualifies as commercialcomputer software or commercial computer software documentation as such terms are used or definedin FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and conditions ofthis Agreement and only those rights specified in this Agreement, shall pertain to and govern the use,modification, reproduction, release, performance, display, and disclosure of the Program and Documentationby the federal government (or other entity acquiring for or through the federal government) and shallsupersede any conflicting contractual terms or conditions. If this License fails to meet the governmentsneeds or is inconsistent in any respect with federal procurement law, the government agrees to return theProgram and Documentation, unused, to The MathWorks, Inc.TrademarksMATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology,SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and TheMathWorks, the L-shaped membrane logo, Embedded MATLAB, and PolySpace aretrademarks of The MathWorks, Inc.Other product or brand names are trademarks or registered trademarks of their respectiveholders.PatentsThe MathWorks products are protected by one or more U.S. patents. Please seewww.mathworks.com/patents for more information. 3. Revision HistoryDecember 1996 First printing For MATLAB 5.0 (Release 8)June 1997 Online only Revised for MATLAB 5.1 (Release 9)October 1997 Online only Revised for MATLAB 5.2 (Release 10)January 1999 Online only Revised for MATLAB 5.3 (Release 11)June 1999 Second printing For MATLAB 5.3 (Release 11)June 2001 Online only Revised for MATLAB 6.1 (Release 12.1)July 2002 Online only Revised for 6.5 (Release 13)June 2004 Online only Revised for 7.0 (Release 14)September 2006 Online only Revised for 7.3 (Release 2006b)September 2007 Online only Revised for 7.5 (Release 2007b) 4. ContentsFunctions By Category1Desktop Tools and Development Environment . . . . . . . 1-3Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3Command Window and History . . . . . . . . . . . . . . . . . . . . . . 1-4Help for Using MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5Workspace, Search Path, and File Operations . . . . . . . . . . 1-6Programming Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-11Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13Arrays and Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14Linear Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-19Elementary Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-23Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-28Interpolation and Computational Geometry . . . . . . . . . . . . 1-28Cartesian Coordinate System Conversion . . . . . . . . . . . . . . 1-31Nonlinear NumericalMethods . . . . . . . . . . . . . . . . . . . . . . . 1-31Specialized Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-35Sparse Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-36Math Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-39Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-41Basic Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-41Descriptive Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-41Filtering and Convolution . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-42Interpolation and Regression . . . . . . . . . . . . . . . . . . . . . . . . 1-42Fourier Transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-43Derivatives and Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-43Time Series Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-44Time Series Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-47Programming and Data Types . . . . . . . . . . . . . . . . . . . . . . 1-49Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-49Data Type Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-58Operators and Special Characters . . . . . . . . . . . . . . . . . . . . 1-60v 5. String Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-63Bit-wise Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-66Logical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-66Relational Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-67Set Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-67Date and Time Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-68Programming in MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . 1-68File I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-76File Name Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-76Opening, Loading, Saving Files . . . . . . . . . . . . . . . . . . . . . . 1-77Memory Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-77Low-Level File I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-77Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-78XML Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-79Spreadsheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-79Scientific Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-80Audio and Audio/Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-81Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-83Internet Exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-84Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-86Basic Plots and Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-86Plotting Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-87Annotating Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-87Specialized Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-88Bit-Mapped Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-92Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-92Handle Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-933-D Visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-97Surface and Mesh Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-97View Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-99Lighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-101Transparency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-101Volume Visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-102Creating Graphical User Interfaces . . . . . . . . . . . . . . . . . 1-104Predefined Dialog Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-104Deploying User Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . 1-105Developing User Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . 1-105User Interface Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-106vi Contents 6. Finding Objects from Callbacks . . . . . . . . . . . . . . . . . . . . . . 1-107GUI Utility Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-107Controlling Program Execution . . . . . . . . . . . . . . . . . . . . . . 1-108External Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-109Dynamic Link Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-109Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-110Component Object Model and ActiveX . . . . . . . . . . . . . . . . . 1-111Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-113Serial Port Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-113Functions Alphabetical List2Indexvii 7. viii Contents 8. 1Functions By CategoryDesktop Tools and DevelopmentEnvironment (p. 1-3)Startup, Command Window, help,editing and debugging, tuning, othergeneral functionsMathematics (p. 1-13) Arrays and matrices, linear algebra,other areas of mathematicsData Analysis (p. 1-41) Basic data operations, descriptivestatistics, covariance and correlation,filtering and convolution, numericalderivatives and integrals, Fouriertransforms, time series analysisProgramming and Data Types(p. 1-49)Function/expression evaluation,program control, function handles,object oriented programming, errorhandling, operators, data types,dates and times, timersFile I/O (p. 1-76) General and low-level file I/O, plusspecific file formats, like audio,spreadsheet, HDF, imagesGraphics (p. 1-86) Line plots, annotating graphs,specialized plots, images, printing,Handle Graphics3-D Visualization (p. 1-97) Surface and mesh plots, view control,lighting and transparency, volumevisualization 9. 1 Functions By CategoryCreating Graphical User Interfaces(p. 1-104)GUIDE, programming graphicaluser interfacesExternal Interfaces (p. 1-109) Interfaces to DLLs, Java, COM andActiveX, Web services, and serialport devices, and C and Fortranroutines1-2 10. Desktop Tools and Development EnvironmentDesktop Tools and Development EnvironmentStartup and Shutdown (p. 1-3) Startup and shutdown options,preferencesCommand Window and History(p. 1-4)Control Command Window andHistory, enter statements and runfunctionsHelp for Using MATLAB (p. 1-5) Command line help, onlinedocumentation in the Help browser,demosWorkspace, Search Path, and FileOperations (p. 1-6)Work with files, MATLAB searchpath, manage variablesProgramming Tools (p. 1-8) Edit and debug M-files, improveperformance, source control, publishresultsSystem (p. 1-11) Identify current computer, license,product version, and moreStartup and Shutdownexit Terminate MATLAB (same as quit)finish MATLAB termination M-filematlab (UNIX) Start MATLAB (UNIX systems)matlab (Windows) Start MATLAB (Windows systems)matlabrc MATLAB startup M-file forsingle-user systems or systemadministratorsprefdir Directory containing preferences,history, and layout filespreferences Open Preferences dialog box forMATLAB and related products1-3 11. 1 Functions By Categoryquit Terminate MATLABstartup MATLAB startup M-file foruser-defined optionsCommand Window and Historyclc Clear Command Windowcommandhistory Open Command History window, orselect it if already opencommandwindow Open Command Window, or select itif already opendiary Save session to filedos Execute DOS command and returnresultformat Set display format for outputhome Move cursor to upper-left corner ofCommand Windowmatlabcolon (matlab:) Run specified function via hyperlinkmore Control paged output for CommandWindowperl Call Perl script using appropriateoperating system executablesystem Execute operating system commandand return resultunix Execute UNIX command and returnresult1-4 12. Desktop Tools and Development EnvironmentHelp for Using MATLABbuilddocsearchdb Build searchable documentationdatabasedemo Access product demos via Helpbrowserdoc Reference page in Help browserdocopt Web browser for UNIX platformsdocsearch Open Help browser Search paneand search for specified termechodemo Run M-file demo step-by-step inCommand Windowhelp Help for MATLAB functions inCommand Windowhelpbrowser Open Help browser to access allonline documentation and demoshelpwin Provide access to M-file help for allfunctionsinfo Information about contacting TheMathWorkslookfor Search for keyword in all helpentriesplayshow Run M-file demo (deprecated; useechodemo instead)support Open MathWorks Technical SupportWeb pageweb Open Web site or file in Web browseror Help browserwhatsnew Release Notes for MathWorksproducts1-5 13. 1 Functions By CategoryWorkspace, Search Path, and File OperationsWorkspace (p. 1-6) Manage variablesSearch Path (p. 1-6) View and change MATLAB searchpathFile Operations (p. 1-7) View and change files and directoriesWorkspaceassignin Assign value to variable in specifiedworkspaceclear Remove items from workspace,freeing up system memoryevalin Execute MATLAB expression inspecified workspaceexist Check existence of variable, function,directory, or Java classopenvar Open workspace variable in ArrayEditor or other tool for graphicaleditingpack Consolidate workspace memoryuiimport Open Import Wizard to import datawhich Locate functions and filesworkspace Open Workspace browser to manageworkspaceSearch Pathaddpath Add directories to MATLAB searchpathgenpath Generate path stringpartialpath Partial pathname description1-6 14. Desktop Tools and Development Environmentpath View or change MATLAB directorysearch pathpath2rc Save current MATLAB search pathto pathdef.m filepathdef Directories in MATLAB search pathpathsep Path separator for current platformpathtool Open Set Path dialog box to viewand change MATLAB pathrestoredefaultpath Restore default MATLAB searchpathrmpath Remove directories from MATLABsearch pathsavepath Save current MATLAB search pathto pathdef.m fileFile OperationsSee also File I/O on page 1-76 functions.cd Change working directorycopyfile Copy file or directorydelete Remove files or graphics objectsdir Directory listingexist Check existence of variable, function,directory, or Java classfileattrib Set or get attributes of file ordirectoryfilebrowser Current Directory browserisdir Determine whether input is adirectorylookfor Search for keyword in all helpentries1-7 15. 1 Functions By Categoryls Directory contents on UNIX systemmatlabroot Root directory of MATLABinstallationmkdir Make new directorymovefile Move file or directorypwd Identify current directoryrecycle Set option to move deleted files torecycle folderrehash Refresh function and file systempath cachesrmdir Remove directorytoolboxdir Root directory for specified toolboxtype Display contents of fileweb Open Web site or file in Web browseror Help browserwhat List MATLAB files in currentdirectorywhich Locate functions and filesProgramming ToolsEdit and Debug M-Files (p. 1-9) Edit and debug M-filesImprove Performance and TuneM-Files (p. 1-9)Improve performance and findpotential problems in M-filesSource Control (p. 1-10) Interface MATLAB with sourcecontrol systemPublishing (p. 1-10) Publish M-file code and results1-8 16. Desktop Tools and Development EnvironmentEdit and Debug M-Filesclipboard Copy and paste strings to and fromsystem clipboarddatatipinfo Produce short description of inputvariabledbclear Clear breakpointsdbcont Resume executiondbdown Change local workspace contextwhen in debug modedbquit Quit debug modedbstack Function call stackdbstatus List all breakpointsdbstep Execute one or more lines fromcurrent breakpointdbstop Set breakpointsdbtype List M-file with line numbersdbup Change local workspace contextdebug List M-file debugging functionsedit Edit or create M-filekeyboard Input from keyboardImprove Performance and Tune M-Filesmemory Help for memory limitationsmlint Check M-files for possible problemsmlintrpt Run mlint for file or directory,reporting results in browserpack Consolidate workspace memoryprofile Profile execution time for function1-9 17. 1 Functions By Categoryprofsave Save profile report in HTML formatrehash Refresh function and file systempath cachessparse Create sparse matrixzeros Create array of all zerosSource Controlcheckin Check files into source controlsystem (UNIX)checkout Check files out of source controlsystem (UNIX)cmopts Name of source control systemcustomverctrl Allow custom source control system(UNIX)undocheckout Undo previous checkout from sourcecontrol system (UNIX)verctrl Source control actions (Windows)Publishinggrabcode MATLAB code from M-filespublished to HTMLnotebook Open M-book in Microsoft Word(Windows)publish Publish M-file containing cells,saving output to file of specified type1-10 18. Desktop Tools and Development EnvironmentSystemOperating System Interface (p. 1-11) Exchange operating systeminformation and commands withMATLABMATLAB Version and License(p. 1-12)Information about MATLAB versionand licenseOperating System Interfaceclipboard Copy and paste strings to and fromsystem clipboardcomputer Information about computer onwhich MATLAB is runningdos Execute DOS command and returnresultgetenv Environment variablehostid MATLAB server host identificationnumbermaxNumCompThreads Controls maximum number ofcomputational threadsperl Call Perl script using appropriateoperating system executablesetenv Set environment variablesystem Execute operating system commandand return resultunix Execute UNIX command and returnresultwinqueryreg Item from Microsoft Windowsregistry1-11 19. 1 Functions By CategoryMATLAB Version and Licenseismac Determine whether runningMacintosh OS X versions ofMATLABispc Determine whether PC (Windows)version of MATLABisstudent Determine whether Student Versionof MATLABisunix Determine whether UNIX version ofMATLABjavachk Generate error message based onJava feature supportlicense Return license number or performlicensing taskprefdir Directory containing preferences,history, and layout filesusejava Determine whether Java feature issupported in MATLABver Version information for MathWorksproductsverLessThan Compare toolbox version to specifiedversion stringversion Version number for MATLAB1-12 20. MathematicsMathematicsArrays and Matrices (p. 1-14) Basic array operators and operations,creation of elementary andspecialized arrays and matricesLinear Algebra (p. 1-19) Matrix analysis, linear equations,eigenvalues, singular values,logarithms, exponentials,factorizationElementary Math (p. 1-23) Trigonometry, exponentials andlogarithms, complex values,rounding, remainders, discrete mathPolynomials (p. 1-28) Multiplication, division, evaluation,roots, derivatives, integration,eigenvalue problem, curve fitting,partial fraction expansionInterpolation and ComputationalGeometry (p. 1-28)Interpolation, Delaunaytriangulation and tessellation,convex hulls, Voronoi diagrams,domain generationCartesian Coordinate SystemConversion (p. 1-31)Conversions between Cartesian andpolar or spherical coordinatesNonlinear Numerical Methods(p. 1-31)Differential equations, optimization,integrationSpecialized Math (p. 1-35) Airy, Bessel, Jacobi, Legendre, beta,elliptic, error, exponential integral,gamma functionsSparse Matrices (p. 1-36) Elementary sparse matrices,operations, reordering algorithms,linear algebra, iterative methods,tree operationsMath Constants (p. 1-39) Pi, imaginary unit, infinity,Not-a-Number, largest and smallestpositive floating point numbers,floating point relative accuracy1-13 21. 1 Functions By CategoryArrays and MatricesBasic Information (p. 1-14) Display array contents, get arrayinformation, determine array typeOperators (p. 1-15) Arithmetic operatorsElementary Matrices and Arrays(p. 1-16)Create elementary arrays of differenttypes, generate arrays for plotting,array indexing, etc.Array Operations (p. 1-17) Operate on array content, applyfunction to each array element, findcumulative product or sum, etc.Array Manipulation (p. 1-17) Create, sort, rotate, permute,reshape, and shift array contentsSpecialized Matrices (p. 1-18) Create Hadamard, Companion,Hankel, Vandermonde, Pascalmatrices, etc.Basic Informationdisp Display text or arraydisplay Display text or array (overloadedmethod)isempty Determine whether array is emptyisequal Test arrays for equalityisequalwithequalnans Test arrays for equality, treatingNaNs as equalisfinite Array elements that are finiteisfloat Determine whether input isfloating-point arrayisinf Array elements that are infiniteisinteger Determine whether input is integerarray1-14 22. Mathematicsislogical Determine whether input is logicalarrayisnan Array elements that are NaNisnumeric Determine whether input is numericarrayisscalar Determine whether input is scalarissparse Determine whether input is sparseisvector Determine whether input is vectorlength Length of vectormax Largest elements in arraymin Smallest elements in arrayndims Number of array dimensionsnumel Number of elements in array orsubscripted array expressionsize Array dimensionsOperators+ Addition+ Unary plus- Subtraction- Unary minus* Matrix multiplication^ Matrix power Backslash or left matrix divide/ Slash or right matrix divide Transpose. Nonconjugated transpose.* Array multiplication (element-wise)1-15 23. 1 Functions By Category.^ Array power (element-wise). Left array divide (element-wise)./ Right array divide (element-wise)Elementary Matrices and Arraysblkdiag Construct block diagonal matrixfrom input argumentsdiag Diagonal matrices and diagonals ofmatrixeye Identity matrixfreqspace Frequency spacing for frequencyresponseind2sub Subscripts from linear indexlinspace Generate linearly spaced vectorslogspace Generate logarithmically spacedvectorsmeshgrid Generate X and Y arrays for 3-D plotsndgrid Generate arrays for N-D functionsand interpolationones Create array of all onesrand Uniformly distributedpseudorandom numbersrandn Normally distributed randomnumberssub2ind Single index from subscriptszeros Create array of all zeros1-16 24. MathematicsArray OperationsSee Linear Algebra on page 1-19 and Elementary Math on page 1-23 forother array operations.accumarray Construct array with accumulationarrayfun Apply function to each element ofarraybsxfun Apply element-by-element binaryoperation to two arrays withsingleton expansion enabledcast Cast variable to different data typecross Vector cross productcumprod Cumulative productcumsum Cumulative sumdot Vector dot productidivide Integer division with roundingoptionkron Kronecker tensor productprod Product of array elementssum Sum of array elementstril Lower triangular part of matrixtriu Upper triangular part of matrixArray Manipulationblkdiag Construct block diagonal matrixfrom input argumentscat Concatenate arrays along specifieddimensioncircshift Shift array circularly1-17 25. 1 Functions By Categorydiag Diagonal matrices and diagonals ofmatrixend Terminate block of code, or indicatelast array indexflipdim Flip array along specified dimensionfliplr Flip matrix left to rightflipud Flip matrix up to downhorzcat Concatenate arrays horizontallyinline Construct inline objectipermute Inverse permute dimensions of N-Darraypermute Rearrange dimensions of N-D arrayrepmat Replicate and tile arrayreshape Reshape arrayrot90 Rotate matrix 90 degreesshiftdim Shift dimensionssort Sort array elements in ascending ordescending ordersortrows Sort rows in ascending ordersqueeze Remove singleton dimensionsvectorize Vectorize expressionvertcat Concatenate arrays verticallySpecialized Matricescompan Companion matrixgallery Test matriceshadamard Hadamard matrixhankel Hankel matrix1-18 26. Mathematicshilb Hilbert matrixinvhilb Inverse of Hilbert matrixmagic Magic squarepascal Pascal matrixrosser Classic symmetric eigenvalue testproblemtoeplitz Toeplitz matrixvander Vandermonde matrixwilkinson Wilkinsons eigenvalue test matrixLinear AlgebraMatrix Analysis (p. 1-19) Compute norm, rank, determinant,condition number, etc.Linear Equations (p. 1-20) Solve linear systems, leastsquares, LU factorization, Choleskyfactorization, etc.Eigenvalues and Singular Values(p. 1-21)Eigenvalues, eigenvectors, Schurdecomposition, Hessenburgmatrices, etc.Matrix Logarithms and Exponentials(p. 1-22)Matrix logarithms, exponentials,square rootFactorization (p. 1-22) Cholesky, LU, and QR factorizations,diagonal forms, singular valuedecompositionMatrix Analysiscond Condition number with respect toinversioncondeig Condition number with respect toeigenvalues1-19 27. 1 Functions By Categorydet Matrix determinantnorm Vector and matrix normsnormest 2-norm estimatenull Null spaceorth Range space of matrixrank Rank of matrixrcond Matrix reciprocal condition numberestimaterref Reduced row echelon formsubspace Angle between two subspacestrace Sum of diagonal elementsLinear Equationschol Cholesky factorizationcholinc Sparse incomplete Cholesky andCholesky-Infinity factorizationscond Condition number with respect toinversioncondest 1-norm condition number estimatefunm Evaluate general matrix functionilu Sparse incomplete LU factorizationinv Matrix inverselinsolve Solve linear system of equationslscov Least-squares solution in presenceof known covariancelsqnonneg Solve nonnegative least-squaresconstraints problemlu LU matrix factorization1-20 28. Mathematicsluinc Sparse incomplete LU factorizationpinv Moore-Penrose pseudoinverse ofmatrixqr Orthogonal-triangulardecompositionrcond Matrix reciprocal condition numberestimateEigenvalues and Singular Valuesbalance Diagonal scaling to improveeigenvalue accuracycdf2rdf Convert complex diagonal form toreal block diagonal formcondeig Condition number with respect toeigenvalueseig Find eigenvalues and eigenvectorseigs Find largest eigenvalues andeigenvectors of sparse matrixgsvd Generalized singular valuedecompositionhess Hessenberg form of matrixordeig Eigenvalues of quasitriangularmatricesordqz Reorder eigenvalues in QZfactorizationordschur Reorder eigenvalues in Schurfactorizationpoly Polynomial with specified rootspolyeig Polynomial eigenvalue problem1-21 29. 1 Functions By Categoryrsf2csf Convert real Schur form to complexSchur formschur Schur decompositionsqrtm Matrix square rootss2tf Convert state-space filterparameters to transfer functionformsvd Singular value decompositionsvds Find singular values and vectorsMatrix Logarithms and Exponentialsexpm Matrix exponentiallogm Matrix logarithmsqrtm Matrix square rootFactorizationbalance Diagonal scaling to improveeigenvalue accuracycdf2rdf Convert complex diagonal form toreal block diagonal formchol Cholesky factorizationcholinc Sparse incomplete Cholesky andCholesky-Infinity factorizationscholupdate Rank 1 update to Choleskyfactorizationgsvd Generalized singular valuedecompositionilu Sparse incomplete LU factorizationlu LU matrix factorization1-22 30. Mathematicsluinc Sparse incomplete LU factorizationplanerot Givens plane rotationqr Orthogonal-triangulardecompositionqrdelete Remove column or row from QRfactorizationqrinsert Insert column or row into QRfactorizationqrupdateqz QZ factorization for generalizedeigenvaluesrsf2csf Convert real Schur form to complexSchur formsvd Singular value decompositionElementary MathTrigonometric (p. 1-24) Trigonometric functions with resultsin radians or degreesExponential (p. 1-25) Exponential, logarithm, power, androot functionsComplex (p. 1-26) Numbers with real and imaginarycomponents, phase anglesRounding and Remainder (p. 1-27) Rounding, modulus, and remainderDiscrete Math (e.g., Prime Factors)(p. 1-27)Prime factors, factorials,permutations, rational fractions,least common multiple, greatestcommon divisor1-23 31. 1 Functions By CategoryTrigonometricacos Inverse cosine; result in radiansacosd Inverse cosine; result in degreesacosh Inverse hyperbolic cosineacot Inverse cotangent; result in radiansacotd Inverse cotangent; result in degreesacoth Inverse hyperbolic cotangentacsc Inverse cosecant; result in radiansacscd Inverse cosecant; result in degreesacsch Inverse hyperbolic cosecantasec Inverse secant; result in radiansasecd Inverse secant; result in degreesasech Inverse hyperbolic secantasin Inverse sine; result in radiansasind Inverse sine; result in degreesasinh Inverse hyperbolic sineatan Inverse tangent; result in radiansatan2 Four-quadrant inverse tangentatand Inverse tangent; result in degreesatanh Inverse hyperbolic tangentcos Cosine of argument in radianscosd Cosine ofo argument in degreescosh Hyperbolic cosinecot Cotangent of argument in radianscotd Cotangent of argument in degreescoth Hyperbolic cotangentcsc Cosecant of argument in radians1-24 32. Mathematicscscd Cosecant of argument in degreescsch Hyperbolic cosecanthypot Square root of sum of squaressec Secant of argument in radianssecd Secant of argument in degreessech Hyperbolic secantsin Sine of argument in radianssind Sine of argument in degreessinh Hyperbolic sine of argument inradianstan Tangent of argument in radianstand Tangent of argument in degreestanh Hyperbolic tangentExponentialexp Exponentialexpm1 Compute exp(x)-1 accurately forsmall values of xlog Natural logarithmlog10 Common (base 10) logarithmlog1p Compute log(1+x) accurately forsmall values of xlog2 Base 2 logarithm and dissectfloating-point numbers intoexponent and mantissanextpow2 Next higher power of 2nthroot Real nth root of real numberspow2 Base 2 power and scale floating-pointnumbers1-25 33. 1 Functions By Categoryreallog Natural logarithm for nonnegativereal arraysrealpow Array power for real-only outputrealsqrt Square root for nonnegative realarrayssqrt Square rootComplexabs Absolute value and complexmagnitudeangle Phase anglecomplex Construct complex data from realand imaginary componentsconj Complex conjugatecplxpair Sort complex numbers into complexconjugate pairsi Imaginary unitimag Imaginary part of complex numberisreal Determine whether input is realarrayj Imaginary unitreal Real part of complex numbersign Signum functionunwrap Correct phase angles to producesmoother phase plots1-26 34. MathematicsRounding and Remainderceil Round toward infinityfix Round toward zerofloor Round toward minus infinityidivide Integer division with roundingoptionmod Modulus after divisionrem Remainder after divisionround Round to nearest integerDiscrete Math (e.g., Prime Factors)factor Prime factorsfactorial Factorial functiongcd Greatest common divisorisprime Array elements that are primenumberslcm Least common multiplenchoosek Binomial coefficient or allcombinationsperms All possible permutationsprimes Generate list of prime numbersrat, rats Rational fraction approximation1-27 35. 1 Functions By CategoryPolynomialsconv Convolution and polynomialmultiplicationdeconv Deconvolution and polynomialdivisionpoly Polynomial with specified rootspolyder Polynomial derivativepolyeig Polynomial eigenvalue problempolyfit Polynomial curve fittingpolyint Integrate polynomial analyticallypolyval Polynomial evaluationpolyvalm Matrix polynomial evaluationresidue Convert between partial fractionexpansion and polynomialcoefficientsroots Polynomial rootsInterpolation and Computational GeometryInterpolation (p. 1-29) Data interpolation, data gridding,polynomial evaluation, nearest pointsearchDelaunay Triangulation andTessellation (p. 1-30)Delaunay triangulation andtessellation, triangular surface andmesh plotsConvex Hull (p. 1-30) Plot convex hull, plotting functionsVoronoi Diagrams (p. 1-30) Plot Voronoi diagram, patch graphicsobject, plotting functionsDomain Generation (p. 1-31) Generate arrays for 3-D plots, or forN-D functions and interpolation1-28 36. MathematicsInterpolationdsearch Search Delaunay triangulation fornearest pointdsearchn N-D nearest point searchgriddata Data griddinggriddata3 Data gridding and hypersurfacefitting for 3-D datagriddatan Data gridding and hypersurfacefitting (dimension >= 2)interp1 1-D data interpolation (table lookup)interp1q Quick 1-D linear interpolationinterp2 2-D data interpolation (table lookup)interp3 3-D data interpolation (table lookup)interpft 1-D interpolation using FFT methodinterpn N-D data interpolation (table lookup)meshgrid Generate X and Y arrays for 3-D plotsmkpp Make piecewise polynomialndgrid Generate arrays for N-D functionsand interpolationpadecoef Pad approximation of time delayspchip Piecewise Cubic HermiteInterpolating Polynomial (PCHIP)ppval Evaluate piecewise polynomialspline Cubic spline data interpolationtsearchn N-D closest simplex searchunmkpp Piecewise polynomial details1-29 37. 1 Functions By CategoryDelaunay Triangulation and Tessellationdelaunay Delaunay triangulationdelaunay3 3-D Delaunay tessellationdelaunayn N-D Delaunay tessellationdsearch Search Delaunay triangulation fornearest pointdsearchn N-D nearest point searchtetramesh Tetrahedron mesh plottrimesh Triangular mesh plottriplot 2-D triangular plottrisurf Triangular surface plottsearch Search for enclosing Delaunaytriangletsearchn N-D closest simplex searchConvex Hullconvhull Convex hullconvhulln N-D convex hullpatch Create patch graphics objectplot 2-D line plottrisurf Triangular surface plotVoronoi Diagramsdsearch Search Delaunay triangulation fornearest pointpatch Create patch graphics objectplot 2-D line plot1-30 38. Mathematicsvoronoi Voronoi diagramvoronoin N-D Voronoi diagramDomain Generationmeshgrid Generate X and Y arrays for 3-D plotsndgrid Generate arrays for N-D functionsand interpolationCartesian Coordinate System Conversioncart2pol Transform Cartesian coordinates topolar or cylindricalcart2sph Transform Cartesian coordinates tosphericalpol2cart Transform polar or cylindricalcoordinates to Cartesiansph2cart Transform spherical coordinates toCartesianNonlinear Numerical MethodsOrdinary Differential Equations(IVP) (p. 1-32)Solve stiff and nonstiff differentialequations, define the problem, setsolver options, evaluate solutionDelay Differential Equations(p. 1-33)Solve delay differential equationswith constant and general delays,set solver options, evaluate solutionBoundary Value Problems (p. 1-33) Solve boundary value problems forordinary differential equations, setsolver options, evaluate solution1-31 39. 1 Functions By CategoryPartial Differential Equations(p. 1-34)Solve initial-boundary valueproblems for parabolic-elliptic PDEs,evaluate solutionOptimization (p. 1-34) Find minimum of single andmultivariable functions, solvenonnegative least-squares constraintproblemNumerical Integration (Quadrature)(p. 1-34)Evaluate Simpson, Lobatto, andvectorized quadratures, evaluatedouble and triple integralsOrdinary Differential Equations (IVP)decic Compute consistent initial conditionsfor ode15ideval Evaluate solution of differentialequation problemode15i Solve fully implicit differentialequations, variable order methodode23, ode45, ode113, ode15s,ode23s, ode23t, ode23tbSolve initial value problems forordinary differential equationsodefile Define differential equation problemfor ordinary differential equationsolversodeget Ordinary differential equationoptions parametersodeset Create or alter options structurefor ordinary differential equationsolversodextend Extend solution of initial valueproblem for ordinary differentialequation1-32 40. MathematicsDelay Differential Equationsdde23 Solve delay differential equations(DDEs) with constant delaysddeget Extract properties from delaydifferential equations optionsstructureddesd Solve delay differential equations(DDEs) with general delaysddeset Create or alter delay differentialequations options structuredeval Evaluate solution of differentialequation problemBoundary Value Problemsbvp4c Solve boundary value problems forordinary differential equationsbvp5c Solve boundary value problems forordinary differential equationsbvpget Extract properties from optionsstructure created with bvpsetbvpinit Form initial guess for bvp4cbvpset Create or alter options structure ofboundary value problembvpxtend Form guess structure for extendingboundary value solutionsdeval Evaluate solution of differentialequation problem1-33 41. 1 Functions By CategoryPartial Differential Equationspdepe Solve initial-boundary valueproblems for parabolic-elliptic PDEsin 1-Dpdeval Evaluate numerical solution of PDEusing output of pdepeOptimizationfminbnd Find minimum of single-variablefunction on fixed intervalfminsearch Find minimum of unconstrainedmultivariable function usingderivative-free methodfzero Find root of continuous function ofone variablelsqnonneg Solve nonnegative least-squaresconstraints problemoptimget Optimization options valuesoptimset Create or edit optimization optionsstructureNumerical Integration (Quadrature)dblquad Numerically evaluate doubleintegralquad Numerically evaluate integral,adaptive Simpson quadraturequadgk Numerically evaluate integral,adaptive Gauss-Kronrod quadraturequadl Numerically evaluate integral,adaptive Lobatto quadrature1-34 42. Mathematicsquadv Vectorized quadraturetriplequad Numerically evaluate triple integralSpecialized Mathairy Airy functionsbesselh Bessel function of third kind (Hankelfunction)besseli Modified Bessel function of first kindbesselj Bessel function of first kindbesselk Modified Bessel function of secondkindbessely Bessel function of second kindbeta Beta functionbetainc Incomplete beta functionbetaln Logarithm of beta functionellipj Jacobi elliptic functionsellipke Complete elliptic integrals of firstand second kinderf, erfc, erfcx, erfinv, erfcinv Error functionsexpint Exponential integralgamma, gammainc, gammaln Gamma functionslegendre Associated Legendre functionspsi Psi (polygamma) function1-35 43. 1 Functions By CategorySparse MatricesElementary SparseMatrices (p. 1-36) Create random and nonrandomsparse matricesFull to Sparse Conversion (p. 1-37) Convert full matrix to sparse, sparsematrix to fullWorking with Sparse Matrices(p. 1-37)Test matrix for sparseness, getinformation on sparse matrix,allocate sparse matrix, applyfunction to nonzero elements,visualize sparsity pattern.Reordering Algorithms (p. 1-37) Random, column, minimum degree,Dulmage-Mendelsohn, and reverseCuthill-McKee permutationsLinear Algebra (p. 1-38) Compute norms, eigenvalues,factorizations, least squares,structural rankLinear Equations (IterativeMethods) (p. 1-38)Methods for conjugate andbiconjugate gradients, residuals,lower quartileTree Operations (p. 1-39) Elimination trees, tree plotting,factorization analysisElementary Sparse Matricesspdiags Extract and create sparse band anddiagonal matricesspeye Sparse identity matrixsprand Sparse uniformly distributedrandom matrixsprandn Sparse normally distributed randommatrixsprandsym Sparse symmetric random matrix1-36 44. MathematicsFull to Sparse Conversionfind Find indices and values of nonzeroelementsfull Convert sparse matrix to full matrixsparse Create sparse matrixspconvert Import matrix from sparse matrixexternal formatWorking with Sparse Matricesissparse Determine whether input is sparsennz Number of nonzero matrix elementsnonzeros Nonzero matrix elementsnzmax Amount of storage allocated fornonzero matrix elementsspalloc Allocate space for sparse matrixspfun Apply function to nonzero sparsematrix elementsspones Replace nonzero sparse matrixelements with onesspparms Set parameters for sparse matrixroutinesspy Visualize sparsity patternReordering Algorithmsamd Approximate minimum degreepermutationcolamd Column approximate minimumdegree permutation1-37 45. 1 Functions By Categorycolperm Sparse column permutation basedon nonzero countdmperm Dulmage-Mendelsohn decompositionldl Block ldl factorization for Hermitianindefinite matricesrandperm Random permutationsymamd Symmetric approximate minimumdegree permutationsymrcm Sparse reverse Cuthill-McKeeorderingLinear Algebracholinc Sparse incomplete Cholesky andCholesky-Infinity factorizationscondest 1-norm condition number estimateeigs Find largest eigenvalues andeigenvectors of sparse matrixilu Sparse incomplete LU factorizationluinc Sparse incomplete LU factorizationnormest 2-norm estimatespaugment Form least squares augmentedsystemsprank Structural ranksvds Find singular values and vectorsLinear Equations (Iterative Methods)bicg Biconjugate gradients methodbicgstab Biconjugate gradients stabilizedmethod1-38 46. Mathematicscgs Conjugate gradients squared methodgmres Generalized minimum residualmethod (with restarts)lsqr LSQR methodminres Minimum residual methodpcg Preconditioned conjugate gradientsmethodqmr Quasi-minimal residual methodsymmlq Symmetric LQ methodTree Operationsetree Elimination treeetreeplot Plot elimination treegplot Plot nodes and links representingadjacency matrixsymbfact Symbolic factorization analysistreelayout Lay out tree or foresttreeplot Plot picture of treeMath Constantseps Floating-point relative accuracyi Imaginary unitInf Infinityintmax Largest value of specified integertypeintmin Smallest value of specified integertypej Imaginary unit1-39 47. 1 Functions By CategoryNaN Not-a-Numberpi Ratio of circles circumference to itsdiameter, realmax Largest positive floating-pointnumberrealmin Smallest positive normalizedfloating-point number1-40 48. Data AnalysisData AnalysisBasic Operations (p. 1-41) Sums, products, sortingDescriptive Statistics (p. 1-41) Statistical summaries of dataFiltering and Convolution (p. 1-42) Data preprocessingInterpolation and RegressionData fitting(p. 1-42)Fourier Transforms (p. 1-43) Frequency content of dataDerivatives and Integrals (p. 1-43) Data rates and accumulationsTime Series Objects (p. 1-44) Methods for timeseries objectsTime Series Collections (p. 1-47) Methods for tscollection objectsBasic Operationscumprod Cumulative productcumsum Cumulative sumprod Product of array elementssort Sort array elements in ascending ordescending ordersortrows Sort rows in ascending ordersum Sum of array elementsDescriptive Statisticscorrcoef Correlation coefficientscov Covariance matrixmax Largest elements in arraymean Average or mean value of arraymedian Median value of array1-41 49. 1 Functions By Categorymin Smallest elements in arraymode Most frequent values in arraystd Standard deviationvar VarianceFiltering and Convolutionconv Convolution and polynomialmultiplicationconv2 2-D convolutionconvn N-D convolutiondeconv Deconvolution and polynomialdivisiondetrend Remove linear trendsfilter 1-D digital filterfilter2 2-D digital filterInterpolation and Regressioninterp1 1-D data interpolation (table lookup)interp2 2-D data interpolation (table lookup)interp3 3-D data interpolation (table lookup)interpn N-D data interpolation (table lookup)mldivide , mrdivide / Left or right matrix divisionpolyfit Polynomial curve fittingpolyval Polynomial evaluation1-42 50. Data AnalysisFourier Transformsabs Absolute value and complexmagnitudeangle Phase anglecplxpair Sort complex numbers into complexconjugate pairsfft Discrete Fourier transformfft2 2-D discrete Fourier transformfftn N-D discrete Fourier transformfftshift Shift zero-frequency component tocenter of spectrumfftw Interface to FFTW library run-timealgorithm tuning controlifft Inverse discrete Fourier transformifft2 2-D inverse discrete Fouriertransformifftn N-D inverse discrete Fouriertransformifftshift Inverse FFT shiftnextpow2 Next higher power of 2unwrap Correct phase angles to producesmoother phase plotsDerivatives and Integralscumtrapz Cumulative trapezoidal numericalintegrationdel2 Discrete Laplaciandiff Differences and approximatederivatives1-43 51. 1 Functions By Categorygradient Numerical gradientpolyder Polynomial derivativepolyint Integrate polynomial analyticallytrapz Trapezoidal numerical integrationTime Series ObjectsGeneral Purpose (p. 1-44) Combine timeseries objects,query and set timeseries objectproperties, plot timeseries objectsData Manipulation (p. 1-45) Add or delete data, manipulatetimeseries objectsEvent Data (p. 1-46) Add or delete events, create newtimeseries objects based on eventdataDescriptive Statistics (p. 1-46) Descriptive statistics for timeseriesobjectsGeneral Purposeget (timeseries) Query timeseries object propertyvaluesgetdatasamplesize Size of data sample in timeseriesobjectgetqualitydesc Data quality descriptionsisempty (timeseries) Determine whether timeseriesobject is emptylength (timeseries) Length of time vectorplot (timeseries) Plot time seriesset (timeseries) Set properties of timeseries objectsize (timeseries) Size of timeseries object1-44 52. Data Analysistimeseries Create timeseries objecttsdata.event Construct event object fortimeseries objecttsprops Help on timeseries objectpropertieststool Open Time Series Tools GUIData Manipulationaddsample Add data sample to timeseriesobjectctranspose (timeseries) Transpose timeseries objectdelsample Remove sample from timeseriesobjectdetrend (timeseries) Subtract mean or best-fit line and allNaNs from time seriesfilter (timeseries) Shape frequency content of timeseriesgetabstime (timeseries) Extract date-string time vector intocell arraygetinterpmethod Interpolation method for timeseriesobjectgetsampleusingtime (timeseries) Extract data samples into newtimeseries objectidealfilter (timeseries) Apply ideal (noncausal) filter totimeseries objectresample (timeseries) Select or interpolate timeseriesdata using new time vectorsetabstime (timeseries) Set times of timeseries object asdate stringssetinterpmethod Set default interpolation method fortimeseries object1-45 53. 1 Functions By Categorysynchronize Synchronize and resample twotimeseries objects using commontime vectortranspose (timeseries) Transpose timeseries objectvertcat (timeseries) Vertical concatenation of timeseriesobjectsEvent Dataaddevent Add event to timeseries objectdelevent Remove tsdata.event objects fromtimeseries objectgettsafteratevent New timeseries object with samplesoccurring at or after eventgettsafterevent New timeseries object with samplesoccurring after eventgettsatevent New timeseries object with samplesoccurring at eventgettsbeforeatevent New timeseries object with samplesoccurring before or at eventgettsbeforeevent New timeseries object with samplesoccurring before eventgettsbetweenevents New timeseries object with samplesoccurring between eventsDescriptive Statisticsiqr (timeseries) Interquartile range of timeseriesdatamax (timeseries) Maximum value of timeseries datamean (timeseries) Mean value of timeseries datamedian (timeseries) Median value of timeseries data1-46 54. Data Analysismin (timeseries) Minimum value of timeseries datastd (timeseries) Standard deviation of timeseriesdatasum (timeseries) Sum of timeseries datavar (timeseries) Variance of timeseries dataTime Series CollectionsGeneral Purpose (p. 1-47) Query and set tscollection objectproperties, plot tscollectionobjectsData Manipulation (p. 1-48) Add or delete data, manipulatetscollection objectsGeneral Purposeget (tscollection) Query tscollection object propertyvaluesisempty (tscollection) Determine whether tscollectionobject is emptylength (tscollection) Length of time vectorplot (timeseries) Plot time seriesset (tscollection) Set properties of tscollectionobjectsize (tscollection) Size of tscollection objecttscollection Create tscollection objecttstool Open Time Series Tools GUI1-47 55. 1 Functions By CategoryData Manipulationaddsampletocollection Add sample to tscollection objectaddts Add timeseries object totscollection objectdelsamplefromcollection Remove sample from tscollectionobjectgetabstime (tscollection) Extract date-string time vector intocell arraygetsampleusingtime (tscollection) Extract data samples into newtscollection objectgettimeseriesnames Cell array of names of timeseriesobjects in tscollection objecthorzcat (tscollection) Horizontal concatenation fortscollection objectsremovets Remove timeseries objects fromtscollection objectresample (tscollection) Select or interpolate data intscollection using new time vectorsetabstime (tscollection) Set times of tscollection object asdate stringssettimeseriesnames Change name of timeseries objectin tscollectionvertcat (tscollection) Vertical concatenation fortscollection objects1-48 56. Programming and Data TypesProgramming and Data TypesData Types (p. 1-49) Numeric, character, structures, cellarrays, and data type conversionData Type Conversion (p. 1-58) Convert one numeric type to another,numeric to string, string to numeric,structure to cell array, etc.Operators and Special Characters(p. 1-60)Arithmetic, relational, and logicaloperators, and special charactersString Functions (p. 1-63) Create, identify, manipulate, parse,evaluate, and compare stringsBit-wise Functions (p. 1-66) Perform set, shift, and, or, compare,etc. on specific bit fieldsLogical Functions (p. 1-66) Evaluate conditions, testing for trueor falseRelational Functions (p. 1-67) Compare values for equality, greaterthan, less than, etc.Set Functions (p. 1-67) Find set members, unions,intersections, etc.Date and Time Functions (p. 1-68) Obtain information about dates andtimesProgramming in MATLAB (p. 1-68) M-files, function/expressionevaluation, program control,function handles, object orientedprogramming, error handlingData TypesNumeric Types (p. 1-50) Integer and floating-point dataCharacters and Strings (p. 1-51) Characters and arrays of charactersStructures (p. 1-52) Data of varying types and sizesstored in fields of a structure1-49 57. 1 Functions By CategoryCell Arrays (p. 1-53) Data of varying types and sizesstored in cells of arrayFunction Handles (p. 1-54) Invoke a function indirectly viahandleMATLAB Classes and Objects(p. 1-55)MATLAB object-oriented classsystemJava Classes and Objects (p. 1-55) Access Java classes throughMATLAB interfaceData Type Identification (p. 1-57) Determine data type of a variableNumeric Typesarrayfun Apply function to each element ofarraycast Cast variable to different data typecat Concatenate arrays along specifieddimensionclass Create object or return class of objectfind Find indices and values of nonzeroelementsintmax Largest value of specified integertypeintmin Smallest value of specified integertypeintwarning Control state of integer warningsipermute Inverse permute dimensions of N-Darrayisa Determine whether input is objectof given classisequal Test arrays for equality1-50 58. Programming and Data Typesisequalwithequalnans Test arrays for equality, treatingNaNs as equalisfinite Array elements that are finiteisinf Array elements that are infiniteisnan Array elements that are NaNisnumeric Determine whether input is numericarrayisreal Determine whether input is realarrayisscalar Determine whether input is scalarisvector Determine whether input is vectorpermute Rearrange dimensions of N-D arrayrealmax Largest positive floating-pointnumberrealmin Smallest positive normalizedfloating-point numberreshape Reshape arraysqueeze Remove singleton dimensionszeros Create array of all zerosCharacters and StringsSee String Functions on page 1-63 for all string-related functions.cellstr Create cell array of strings fromcharacter arraychar Convert to character array (string)eval Execute string containing MATLABexpressionfindstr Find string within another, longerstring1-51 59. 1 Functions By Categoryisstr Determine whether input ischaracter arrayregexp, regexpi Match regular expressionsprintf Write formatted data to stringsscanf Read formatted data from stringstrcat Concatenate strings horizontallystrcmp, strcmpi Compare stringsstrings MATLAB string handlingstrjust Justify character arraystrmatch Find possible matches for stringstrread Read formatted data from stringstrrep Find and replace substringstrtrim Remove leading and trailing whitespace from stringstrvcat Concatenate strings verticallyStructuresarrayfun Apply function to each element ofarraycell2struct Convert cell array to structure arrayclass Create object or return class of objectdeal Distribute inputs to outputsfieldnames Field names of structure, or publicfields of objectgetfield Field of structure arrayisa Determine whether input is objectof given classisequal Test arrays for equality1-52 60. Programming and Data Typesisfield Determine whether input isstructure array fieldisscalar Determine whether input is scalarisstruct Determine whether input isstructure arrayisvector Determine whether input is vectororderfields Order fields of structure arrayrmfield Remove fields from structuresetfield Set value of structure array fieldstruct Create structure arraystruct2cell Convert structure to cell arraystructfun Apply function to each field of scalarstructureCell Arrayscell Construct cell arraycell2mat Convert cell array of matrices tosingle matrixcell2struct Convert cell array to structure arraycelldisp Cell array contentscellfun Apply function to each cell in cellarraycellplot Graphically display structure of cellarraycellstr Create cell array of strings fromcharacter arrayclass Create object or return class of objectdeal Distribute inputs to outputs1-53 61. 1 Functions By Categoryisa Determine whether input is objectof given classiscell Determine whether input is cellarrayiscellstr Determine whether input is cellarray of stringsisequal Test arrays for equalityisscalar Determine whether input is scalarisvector Determine whether input is vectormat2cell Divide matrix into cell array ofmatricesnum2cell Convert numeric array to cell arraystruct2cell Convert structure to cell arrayFunction Handlesclass Create object or return class of objectfeval Evaluate functionfunc2str Construct function name string fromfunction handlefunctions Information about function handlefunction_handle (@) Handle used in calling functionsindirectlyisa Determine whether input is objectof given classisequal Test arrays for equalitystr2func Construct function handle fromfunction name string1-54 62. Programming and Data TypesMATLAB Classes and Objectsclass Create object or return class of objectfieldnames Field names of structure, or publicfields of objectinferiorto Establish inferior class relationshipisa Determine whether input is objectof given classisobject Determine whether input isMATLAB OOPs objectloadobj User-defined extension of loadfunction for user objectsmethods Information on class methodsmethodsview Information on class methods inseparate windowsaveobj User-defined extension of savefunction for user objectssubsasgn Subscripted assignment for objectssubsindex Subscripted indexing for objectssubsref Subscripted reference for objectssubstruct Create structure argument forsubsasgn or subsrefsuperiorto Establish superior class relationshipJava Classes and Objectscell Construct cell arrayclass Create object or return class of objectclear Remove items from workspace,freeing up system memorydepfun List dependencies of M-file or P-file1-55 63. 1 Functions By Categoryexist Check existence of variable, function,directory, or Java classfieldnames Field names of structure, or publicfields of objectim2java Convert image to Java imageimport Add package or class to current Javaimport listinmem Names of M-files, MEX-files, Javaclasses in memoryisa Determine whether input is objectof given classisjava Determine whether input is Javaobjectjavaaddpath Add entries to dynamic Java classpathjavaArray Construct Java arrayjavachk Generate error message based onJava feature supportjavaclasspath Set and get dynamic Java class pathjavaMethod Invoke Java methodjavaObject Construct Java objectjavarmpath Remove entries from dynamic Javaclass pathmethods Information on class methodsmethodsview Information on class methods inseparate windowusejava Determine whether Java feature issupported in MATLABwhich Locate functions and files1-56 64. Programming and Data TypesData Type Identificationis* Detect stateisa Determine whether input is objectof given classiscell Determine whether input is cellarrayiscellstr Determine whether input is cellarray of stringsischar Determine whether item is characterarrayisfield Determine whether input isstructure array fieldisfloat Determine whether input isfloating-point arrayisinteger Determine whether input is integerarrayisjava Determine whether input is Javaobjectislogical Determine whether input is logicalarrayisnumeric Determine whether input is numericarrayisobject Determine whether input isMATLAB OOPs objectisreal Determine whether input is realarrayisstr Determine whether input ischaracter arrayisstruct Determine whether input isstructure array1-57 65. 1 Functions By Categoryvalidateattributes Check validity of arraywho, whos List variables in workspaceData Type ConversionNumeric (p. 1-58) Convert data of one numeric type toanother numeric typeString to Numeric (p. 1-58) Convert characters to numericequivalentNumeric to String (p. 1-59) Convert numeric to characterequivalentOther Conversions (p. 1-59) Convert to structure, cell array,function handle, etc.Numericcast Cast variable to different data typedouble Convert to double precisionint8, int16, int32, int64 Convert to signed integersingle Convert to single precisiontypecast Convert data types without changingunderlying datauint8, uint16, uint32, uint64 Convert to unsigned integerString to Numericbase2dec Convert base N number string todecimal numberbin2dec Convert binary number string todecimal numbercast Cast variable to different data type1-58 66. Programming and Data Typeshex2dec Convert hexadecimal number stringto decimal numberhex2num Convert hexadecimal number stringto double-precision numberstr2double Convert string to double-precisionvaluestr2num Convert string to numberunicode2native Convert Unicode characters tonumeric bytesNumeric to Stringcast Cast variable to different data typechar Convert to character array (string)dec2base Convert decimal to base N numberin stringdec2bin Convert decimal to binary numberin stringdec2hex Convert decimal to hexadecimalnumber in stringint2str Convert integer to stringmat2str Convert matrix to stringnative2unicode Convert numeric bytes to Unicodecharactersnum2str Convert number to stringOther Conversionscell2mat Convert cell array of matrices tosingle matrixcell2struct Convert cell array to structure array1-59 67. 1 Functions By Categorydatestr Convert date and time to stringformatfunc2str Construct function name string fromfunction handlelogical Convert numeric values to logicalmat2cell Divide matrix into cell array ofmatricesnum2cell Convert numeric array to cell arraynum2hex Convert singles and doubles to IEEEhexadecimal stringsstr2func Construct function handle fromfunction name stringstr2mat Form blank-padded character matrixfrom stringsstruct2cell Convert structure to cell arrayOperators and Special CharactersArithmetic Operators (p. 1-60) Plus, minus, power, left and rightdivide, transpose, etc.Relational Operators (p. 1-61) Equal to, greater than, less than orequal to, etc.Logical Operators (p. 1-61) Element-wise and short circuit and,or, notSpecial Characters (p. 1-62) Array constructors, linecontinuation, comments, etc.Arithmetic Operators+ Plus- Minus1-60 68. Programming and Data Types. Decimal point= Assignment* Matrix multiplication/ Matrix right division Matrix left division^ Matrix power Matrix transpose.* Array multiplication (element-wise)./ Array right division (element-wise). Array left division (element-wise).^ Array power (element-wise). Array transposeRelational Operators< Less than Greater than>= Greater than or equal to== Equal to~= Not equal toLogical OperatorsSee also Logical Functions on page 1-66 for functions like xor, all, any, etc.&& Logical AND|| Logical OR& Logical AND for arrays1-61 69. 1 Functions By Category| Logical OR for arrays~ Logical NOTSpecial Characters: Create vectors, subscript arrays, specify for-loop iterations( ) Pass function arguments, prioritize operators[ ] Construct array, concatenate elements, specify multipleoutputs from function{ } Construct cell array, index into cell array. Insert decimal point, define structure field, reference methodsof object.( ) Reference dynamic field of structure.. Reference parent directory... Continue statement to next line, Separate rows of array, separate function input/outputarguments, separate commands; Separate columns of array, suppress output from currentcommand% Insert comment line into code%{ %} Insert block of comments into code! Issue command to operating system Construct character array@ Construct function handle, reference class directory1-62 70. Programming and Data TypesString FunctionsDescription of Strings in MATLAB(p. 1-63)Basics of string handling inMATLABString Creation (p. 1-63) Create strings, cell arrays of strings,concatenate strings togetherString Identification (p. 1-64) Identify characteristics of stringsString Manipulation (p. 1-64) Convert case, strip blanks, replacecharactersString Parsing (p. 1-65) Formatted read, regular expressions,locate substringsString Evaluation (p. 1-65) Evaluate stated expression in stringString Comparison (p. 1-65) Compare contents of stringsDescription of Strings in MATLABstrings MATLAB string handlingString Creationblanks Create string of blank characterscellstr Create cell array of strings fromcharacter arraychar Convert to character array (string)sprintf Write formatted data to stringstrcat Concatenate strings horizontallystrvcat Concatenate strings vertically1-63 71. 1 Functions By CategoryString Identificationclass Create object or return class of objectisa Determine whether input is objectof given classiscellstr Determine whether input is cellarray of stringsischar Determine whether item is characterarrayisletter Array elements that are alphabeticlettersisscalar Determine whether input is scalarisspace Array elements that are spacecharactersisstrprop Determine whether string is ofspecified categoryisvector Determine whether input is vectorvalidatestring Check validity of text stringString Manipulationdeblank Strip trailing blanks from end ofstringlower Convert string to lowercasestrjust Justify character arraystrrep Find and replace substringstrtrim Remove leading and trailing whitespace from stringupper Convert string to uppercase1-64 72. Programming and Data TypesString Parsingfindstr Find string within another, longerstringregexp, regexpi Match regular expressionregexprep Replace string using regularexpressionregexptranslate Translate string into regularexpressionsscanf Read formatted data from stringstrfind Find one string within anotherstrread Read formatted data from stringstrtok Selected parts of stringString Evaluationeval Execute string containing MATLABexpressionevalc Evaluate MATLAB expression withcaptureevalin Execute MATLAB expression inspecified workspaceString Comparisonstrcmp, strcmpi Compare stringsstrmatch Find possible matches for stringstrncmp, strncmpi Compare first n characters of strings1-65 73. 1 Functions By CategoryBit-wise Functionsbitand Bitwise ANDbitcmp Bitwise complementbitget Bit at specified positionbitmax Maximum double-precisionfloating-point integerbitor Bitwise ORbitset Set bit at specified positionbitshift Shift bits specified number of placesbitxor Bitwise XORswapbytes Swap byte orderingLogical Functionsall Determine whether all arrayelements are nonzeroand Find logical AND of array or scalarinputsany Determine whether any arrayelements are nonzerofalse Logical 0 (false)find Find indices and values of nonzeroelementsisa Determine whether input is objectof given classiskeyword Determine whether input isMATLAB keywordisvarname Determine whether input is validvariable namelogical Convert numeric values to logical1-66 74. Programming and Data Typesnot Find logical NOT of array or scalarinputor Find logical OR of array or scalarinputstrue Logical 1 (true)xor Logical exclusive-ORSee Operators and Special Characters on page 1-60 for logical operators.Relational Functionseq Test for equalityge Test for greater than or equal togt Test for greater thanle Test for less than or equal tolt Test for less thanne Test for inequalitySee Operators and Special Characters on page 1-60 for relational operators.Set Functionsintersect Find set intersection of two vectorsismember Array elements that are membersof setissorted Determine whether set elements arein sorted ordersetdiff Find set difference of two vectorssetxor Find set exclusive OR of two vectorsunion Find set union of two vectorsunique Find unique elements of vector1-67 75. 1 Functions By CategoryDate and Time Functionsaddtodate Modify date number by fieldcalendar Calendar for specified monthclock Current time as date vectorcputime Elapsed CPU timedate Current date stringdatenum Convert date and time to serial datenumberdatestr Convert date and time to stringformatdatevec Convert date and time to vector ofcomponentseomday Last day of monthetime Time elapsed between date vectorsnow Current date and timeweekday Day of weekProgramming in MATLABM-File Functions and Scripts(p. 1-69)Declare functions, handlearguments, identify dependencies,etc.Evaluation of Expressions andFunctions (p. 1-70)Evaluate expression in string, applyfunction to array, run script file, etc.Timer Functions (p. 1-71) Schedule execution of MATLABcommandsVariables and Functions in Memory(p. 1-72)List files in memory, clear M-filesin memory, assign to variable innondefault workspace, refreshcaches1-68 76. Programming and Data TypesControl Flow (p. 1-73) if-then-else, for loops, switch-case,try-catchError Handling (p. 1-74) Generate warnings and errors, testfor and catch errors, retrieve mostrecent error messageMEX Programming (p. 1-75) Compile MEX function from Cor Fortran code, list MEX-files inmemory, debug MEX-filesM-File Functions and ScriptsaddOptional (inputParser) Add optional argument toinputParser schemaaddParamValue (inputParser) Add parameter-value argument toinputParser schemaaddRequired (inputParser) Add required argument toinputParser schemacreateCopy (inputParser) Create copy of inputParser objectdepdir List dependent directories of M-fileor P-filedepfun List dependencies of M-file or P-fileecho Echo M-files during executionend Terminate block of code, or indicatelast array indexfunction Declare M-file functioninput Request user inputinputname Variable name of function inputinputParser Construct input parser objectmfilename Name of currently running M-filenamelengthmax Maximum identifier lengthnargchk Validate number of input arguments1-69 77. 1 Functions By Categorynargin, nargout Number of function argumentsnargoutchk Validate number of outputargumentsparse (inputParser) Parse and validate named inputspcode Create preparsed pseudocode file(P-file)script Script M-file descriptionsyntax Two ways to call MATLAB functionsvarargin Variable length input argument listvarargout Variable length output argument listEvaluation of Expressions and Functionsans Most recent answerarrayfun Apply function to each element ofarrayassert Generate error when condition isviolatedbuiltin Execute built-in function fromoverloaded methodcellfun Apply function to each cell in cellarrayecho Echo M-files during executioneval Execute string containing MATLABexpressionevalc Evaluate MATLAB expression withcaptureevalin Execute MATLAB expression inspecified workspacefeval Evaluate function1-70 78. Programming and Data Typesiskeyword Determine whether input isMATLAB keywordisvarname Determine whether input is validvariable namepause Halt execution temporarilyrun Run script that is not on currentpathscript Script M-file descriptionstructfun Apply function to each field of scalarstructuresymvar Determine symbolic variables inexpressiontic, toc Measure performance usingstopwatch timerTimer Functionsdelete (timer) Remove timer object from memorydisp (timer) Information about timer objectget (timer) Timer object propertiesisvalid (timer) Determine whether timer object isvalidset (timer) Configure or display timer objectpropertiesstart Start timer(s) runningstartat Start timer(s) running at specifiedtimestop Stop timer(s)timer Construct timer objecttimerfind Find timer objects1-71 79. 1 Functions By Categorytimerfindall Find timer objects, includinginvisible objectswait Wait until timer stops runningVariables and Functions in Memoryans Most recent answerassignin Assign value to variable in specifiedworkspacedatatipinfo Produce short description of inputvariablegenvarname Construct valid variable name fromstringglobal Declare global variablesinmem Names of M-files, MEX-files, Javaclasses in memoryisglobal Determine whether input is globalvariablemislocked Determine whether M-file orMEX-file cannot be cleared frommemorymlock Prevent clearing M-file or MEX-filefrom memorymunlock Allow clearing M-file or MEX-filefrom memorynamelengthmax Maximum identifier lengthpack Consolidate workspace memorypersistent Define persistent variablerehash Refresh function and file systempath caches1-72 80. Programming and Data TypesControl Flowbreak Terminate execution of for or whileloopcase Execute block of code if condition istruecatch Specify how to respond to error intry statementcontinue Pass control to next iteration of foror while loopelse Execute statements if condition isfalseelseif Execute statements if additionalcondition is trueend Terminate block of code, or indicatelast array indexerror Display message and abort functionfor Execute block of code specifiednumber of timesif Execute statements if condition istrueotherwise Default part of switch statementreturn Return to invoking functionswitch Switch among several cases, basedon expressiontry Attempt to execute block of code, andcatch errorswhile Repeatedly execute statements whilecondition is true1-73 81. 1 Functions By CategoryError HandlingaddCause (MException) Append MException objectsassert Generate error when condition isviolatedcatch Specify how to respond to error intry statementdisp (MException) Display MException objecteq (MException) Compare MException objects forequalityerror Display message and abort functionferror Query MATLAB about errors in fileinput or outputgetReport (MException) Get error message for exceptionintwarning Control state of integer warningsisequal (MException) Compare MException objects forequalitylast (MException) Last uncaught exceptionlasterr Last error messagelasterror Last error message and relatedinformationlastwarn Last warning messageMException Construct MException objectne (MException) Compare MException objects forinequalityrethrow Reissue errorrethrow (MException) Reissue existing exceptionthrow (MException) Terminate function and issueexception1-74 82. Programming and Data Typestry Attempt to execute block of code, andcatch errorswarning Warning messageMEX Programmingdbmex Enable MEX-file debugginginmem Names of M-files, MEX-files, Javaclasses in memorymex Compile MEX-function from C, C++,or Fortran source codemexext MEX-filename extension1-75 83. 1 Functions By CategoryFile I/OFile Name Construction (p. 1-76) Get path, directory, filenameinformation; construct filenamesOpening, Loading, Saving Files(p. 1-77)Open files; transfer data betweenfiles and MATLAB workspaceMemory Mapping (p. 1-77) Access file data via memory mapusing MATLAB array indexingLow-Level File I/O (p. 1-77) Low-level operations that use a fileidentifierText Files (p. 1-78) Delimited or formatted I/O to textfilesXML Documents (p. 1-79) Documents written in ExtensibleMarkup LanguageSpreadsheets (p. 1-79) Excel and Lotus 1-2-3 filesScientific Data (p. 1-80) CDF, FITS, HDF formatsAudio and Audio/Video (p. 1-81) General audio functions;SparcStation, WAVE, AVI filesImages (p. 1-83) Graphics filesInternet Exchange (p. 1-84) URL, FTP, zip, tar, and e-mailTo see a listing of file formats that are readable from MATLAB, go to fileformats.File Name Constructionfilemarker Character to separate file name andinternal function namefileparts Parts of file name and pathfilesep Directory separator for currentplatformfullfile Build full filename from parts1-76 84. File I/Otempdir Name of systems temporarydirectorytempname Unique name for temporary fileOpening, Loading, Saving Filesdaqread Read Data Acquisition Toolbox (.daq)filefilehandle Construct file handle objectimportdata Load data from disk fileload Load workspace variables from diskopen Open files based on extensionsave Save workspace variables to diskuiimport Open Import Wizard to import datawinopen Open file in appropriate application(Windows)Memory Mappingdisp (memmapfile) Information about memmapfileobjectget (memmapfile) Memmapfile object propertiesmemmapfile Construct memmapfile objectLow-Level File I/Ofclose Close one or more open filesfeof Test for end-of-fileferror Query MATLAB about errors in fileinput or output1-77 85. 1 Functions By Categoryfgetl Read line from file, discardingnewline characterfgets Read line from file, keeping newlinecharacterfopen Open file, or obtain informationabout open filesfprintf Write formatted data to filefread Read binary data from filefrewind Move file position indicator tobeginning of open filefscanf Read formatted data from filefseek Set file position indicatorftell File position indicatorfwrite Write binary data to fileText Filescsvread Read comma-separated value filecsvwrite Write comma-separated value filedlmread Read ASCII-delimited file of numericdata into matrixdlmwrite Write matrix to ASCII-delimited filetextread Read data from text file; write tomultiple outputstextscan Read formatted data from text fileor string1-78 86. File I/OXML Documentsxmlread Parse XML document and returnDocument Object Model nodexmlwrite Serialize XML Document ObjectModel nodexslt Transform XML document usingXSLT engineSpreadsheetsMicrosoft Excel Functions (p. 1-79) Read and write Microsoft ExcelspreadsheetLotus 1-2-3 Functions (p. 1-79) Read and write Lotus WK1spreadsheetMicrosoft Excel Functionsxlsfinfo Determine whether file containsMicrosoft Excel (.xls) spreadsheetxlsread Read Microsoft Excel spreadsheetfile (.xls)xlswrite Write Microsoft Excel spreadsheetfile (.xls)Lotus 1-2-3 Functionswk1finfo Determine whether file contains1-2-3 WK1 worksheetwk1read Read Lotus 1-2-3 WK1 spreadsheetfile into matrixwk1write Write matrix to Lotus 1-2-3 WK1spreadsheet file1-79 87. 1 Functions By CategoryScientific DataCommon Data Format (CDF)(p. 1-80)Work with CDF filesFlexible Image Transport System(p. 1-80)Work with FITS filesHierarchical Data Format (HDF)(p. 1-81)Work with HDF filesBand-Interleaved Data (p. 1-81) Work with band-interleaved filesCommon Data Format (CDF)cdfepoch Construct cdfepoch object forCommon Data Format (CDF) exportcdfinfo Information about Common DataFormat (CDF) filecdfread Read data from Common DataFormat (CDF) filecdfwrite Write data to Common Data Format(CDF) filetodatenum Convert CDF epoch object toMATLAB datenumFlexible Image Transport Systemfitsinfo Information about FITS filefitsread Read data from FITS file1-80 88. File I/OHierarchical Data Format (HDF)hdf Summary of MATLAB HDF4capabilitieshdf5 Summary of MATLAB HDF5capabilitieshdf5info Information about HDF5 filehdf5read Read HDF5 filehdf5write Write data to file in HDF5 formathdfinfo Information about HDF4 orHDF-EOS filehdfread Read data from HDF4 or HDF-EOSfilehdftool Browse and import data from HDF4or HDF-EOS filesBand-Interleaved Datamultibandread Read band-interleaved data frombinary filemultibandwrite Write band-interleaved data to fileAudio and Audio/VideoGeneral (p. 1-82) Create audio player object, obtaininformation about multimedia files,convert to/from audio signalSPARCstation-Specific SoundFunctions (p. 1-82)Access NeXT/SUN (.au) sound files1-81 89. 1 Functions By CategoryMicrosoft WAVE Sound Functions(p. 1-83)Access Microsoft WAVE (.wav) soundfilesAudio/Video Interleaved (AVI)Functions (p. 1-83)Access Audio/Video interleaved(.avi) sound filesGeneralaudioplayer Create audio player objectaudiorecorder Create audio recorder objectbeep Produce beep soundlin2mu Convert linear audio signal tomu-lawmmfileinfo Information about multimedia filemmreader Create multimedia reader object forreading video filesmu2lin Convert mu-law audio signal tolinearread Read video frame data frommultimedia reader objectsound Convert vector into soundsoundsc Scale data and play as soundSPARCstation-Specific Sound Functionsaufinfo Information about NeXT/SUN (.au)sound fileauread Read NeXT/SUN (.au) sound fileauwrite Write NeXT/SUN (.au) sound file1-82 90. File I/OMicrosoft WAVE Sound Functionswavfinfo Information about Microsoft WAVE(.wav) sound filewavplay Play recorded sound on PC-basedaudio output devicewavread Read Microsoft WAVE (.wav) soundfilewavrecord Record sound using PC-based audioinput devicewavwrite Write Microsoft WAVE (.wav) soundfileAudio/Video Interleaved (AVI) Functionsaddframe Add frame to Audio/VideoInterleaved (AVI) fileavifile Create new Audio/Video Interleaved(AVI) fileaviinfo Information about Audio/VideoInterleaved (AVI) fileaviread Read Audio/Video Interleaved (AVI)fileclose (avifile) Close Audio/Video Interleaved (AVI)filemovie2avi Create Audio/Video Interleaved(AVI) movie from MATLAB movieImagesexifread Read EXIF information from JPEGand TIFF image filesim2java Convert image to Java image1-83 91. 1 Functions By Categoryimfinfo Information about graphics fileimread Read image from graphics fileimwrite Write image to graphics fileInternet ExchangeURL, Zip, Tar, E-Mail (p. 1-84) Send e-mail, read from given URL,extract from tar or zip file, compressand decompress filesFTP Functions (p. 1-84) Connect to FTP server, downloadfrom server, manage FTP files, closeserver connectionURL, Zip, Tar, E-Mailgunzip Uncompress GNU zip filesgzip Compress files into GNU zip filessendmail Send e-mail message to address listtar Compress files into tar fileuntar Extract contents of tar fileunzip Extract contents of zip fileurlread Read content at URLurlwrite Save contents of URL to filezip Compress files into zip fileFTP Functionsascii Set FTP transfer type to ASCIIbinary Set FTP transfer type to binary1-84 92. File I/Ocd (ftp) Change current directory on FTPserverclose (ftp) Close connection to FTP serverdelete (ftp) Remove file on FTP serverdir (ftp) Directory contents on FTP serverftp Connect to FTP server, creating FTPobjectmget Download file from FTP servermkdir (ftp) Create new directory on FTP servermput Upload file or directory to FTP serverrename Rename file on FTP serverrmdir (ftp) Remove directory on FTP server1-85 93. 1 Functions By CategoryGraphicsBasic Plots and Graphs (p. 1-86) Linear line plots, log and semilogplotsPlotting Tools (p. 1-87) GUIs for interacting with plotsAnnotating Plots (p. 1-87) Functions for and properties of titles,axes labels, legends, mathematicalsymbolsSpecialized Plotting (p. 1-88) Bar graphs, histograms, pie charts,contour plots, function plottersBit-Mapped Images (p. 1-92) Display image object, read andwrite graphics file, convert to movieframesPrinting (p. 1-92) Printing and exporting figures tostandard formatsHandle Graphics (p. 1-93) Creating graphics objects, settingproperties, finding handlesBasic Plots and Graphsbox Axes bordererrorbar Plot error bars along curvehold Retain current graph in figureLineSpec Line specification string syntaxloglog Log-log scale plotplot 2-D line plotplot3 3-D line plotplotyy 2-D line plots with y-axes on bothleft and right sidepolar Polar coordinate plot1-86 94. Graphicssemilogx, semilogy Semilogarithmic plotssubplot Create axes in tiled positionsPlotting Toolsfigurepalette Show or hide figure palettepan Pan view of graph interactivelyplotbrowser Show or hide figure plot browserplotedit Interactively edit and annotate plotsplottools Show or hide plot toolspropertyeditor Show or hide property editorrotate3d Rotate 3-D view using mouseshowplottool Show or hide figure plot toolzoom Turn zooming on or off or magnifyby factorAnnotating Plotsannotation Create annotation objectsclabel Contour plot elevation labelsdatacursormode Enable or disable interactive datacursor modedatetick Date formatted tick labelsgtext Mouse placement of text in 2-D viewlegend Graph legend for lines and patchesline Create line objectrectangle Create 2-D rectangle objecttexlabel Produce TeX format from characterstring1-87 95. 1 Functions By Categorytitle Add title to current axesxlabel, ylabel, zlabel Label x-, y-, and z-axisSpecialized PlottingArea, Bar, and Pie Plots (p. 1-88) 1-D, 2-D, and 3-D graphs and chartsContour Plots (p. 1-89) Unfilled and filled contours in 2-Dand 3-DDirection and Velocity Plots (p. 1-89) Comet, compass, feather and quiverplotsDiscrete Data Plots (p. 1-89) Stair, step, and stem plotsFunction Plots (p. 1-89) Easy-to-use plotting utilities forgraphing functionsHistograms (p. 1-90) Plots for showing distributions ofdataPolygons and Surfaces (p. 1-90) Functions to generate and plotsurface patches in two or moredimensionsScatter/Bubble Plots (p. 1-91) Plots of point distributionsAnimation (p. 1-91) Functions to create and play moviesof plotsArea, Bar, and Pie Plotsarea Filled area 2-D plotbar, barh Plot bar graph (vertical andhorizontal)bar3, bar3h Plot 3-D bar chartpareto Pareto chartpie Pie chartpie3 3-D pie chart1-88 96. GraphicsContour Plotscontour Contour plot of matrixcontour3 3-D contour plotcontourc Low-level contour plot computationcontourf Filled 2-D contour plotezcontour Easy-to-use contour plotterezcontourf Easy-to-use filled contour plotterDirection and Velocity Plotscomet 2-D comet plotcomet3 3-D comet plotcompass Plot arrows emanating from originfeather Plot velocity vectorsquiver Quiver or velocity plotquiver3 3-D quiver or velocity plotDiscrete Data Plotsstairs Stairstep graphstem Plot discrete sequence datastem3 Plot 3-D discrete sequence dataFunction Plotsezcontour Easy-to-use contour plotterezcontourf Easy-to-use filled contour plotterezmesh Easy-to-use 3-D mesh plotter1-89 97. 1 Functions By Categoryezmeshc Easy-to-use combinationmesh/contour plotterezplot Easy-to-use function plotterezplot3 Easy-to-use 3-D parametric curveplotterezpolar Easy-to-use polar coordinate plotterezsurf Easy-to-use 3-D colored surfaceplotterezsurfc Easy-to-use combinationsurface/contour plotterfplot Plot function between specifiedlimitsHistogramshist Histogram plothistc Histogram countrose Angle histogram plotPolygons and Surfacesconvhull Convex hullcylinder Generate cylinderdelaunay Delaunay triangulationdelaunay3 3-D Delaunay tessellationdelaunayn N-D Delaunay tessellationdsearch Search Delaunay triangulation fornearest pointdsearchn N-D nearest point searchellipsoid Generate ellipsoid1-90 98. Graphicsfill Filled 2-D polygonsfill3 Filled 3-D polygonsinpolygon Points inside polygonal regionpcolor Pseudocolor (checkerboard) plotpolyarea Area of polygonrectint Rectangle intersection arearibbon Ribbon plotslice Volumetric slice plotsphere Generate spheretsearch Search for enclosing Delaunaytriangletsearchn N-D closest simplex searchvoronoi Voronoi diagramwaterfall Waterfall plotScatter/Bubble Plotsplotmatrix Scatter plot matrixscatter Scatter plotscatter3 3-D scatter plotAnimationframe2im Convert movie frame to indexedimagegetframe Capture movie frameim2frame Convert image to movie frame1-91 99. 1 Functions By Categorymovie Play recorded movie framesnoanimate Change EraseMode of all objects tonormalBit-Mapped Imagesframe2im Convert movie frame to indexedimageim2frame Convert image to movie frameim2java Convert image to Java imageimage Display image objectimagesc Scale data and display image objectimfinfo Information about graphics fileimformats Manage image file format registryimread Read image from graphics fileimwrite Write image to graphics fileind2rgb Convert indexed image to RGBimagePrintingframeedit Edit print frames for Simulink andStateflow block diagramshgexport Export figureorient Hardcopy paper orientationprint, printopt Print figure or save to file andconfigure printer defaultsprintdlg Print dialog box1-92 100. Graphicsprintpreview Preview figure to printsaveas Save figure or Simulink blockdiagram using specified formatHandle GraphicsFinding and Identifying GraphicsObjects (p. 1-93)Find and manipulate graphicsobjects via their handlesObject Creation Functions (p. 1-94) Constructors for core graphicsobjectsPlot Objects (p. 1-94) Property descriptions for plot objectsFigure Windows (p. 1-95) Control and save figuresAxes Operations (p. 1-96) Operate on axes objectsOperating on Object Properties(p. 1-96)Query, set, and link object propertiesFinding and Identifying Graphics Objectsallchild Find all children of specified objectsancestor Ancestor of graphics objectcopyobj Copy graphics objects and theirdescendantsdelete Remove files or graphics objectsfindall Find all graphics objectsfindfigs Find visible offscreen figuresfindobj Locate graphics objects with specificpropertiesgca Current axes handlegcbf Handle of figure containing objectwhose callback is executing1-93 101. 1 Functions By Categorygcbo Handle of object whose callback isexecutinggco Handle of current objectget Query object propertiesishandle Is object handle validpropedit Open Property Editorset Set object propertiesObject Creation Functionsaxes Create axes graphics objectfigure Create figure graphics objecthggroup Create hggroup objecthgtransform Create hgtransform graphics objectimage Display image objectlight Create light objectline Create line objectpatch Create patch graphics objectrectangle Create 2-D rectangle objectroot object Root object propertiessurface Create surface objecttext Create text object in current axesuicontextmenu Create context menuPlot ObjectsAnnotation Arrow Properties Define annotation arrow propertiesAnnotation Doublearrow Properties Define annotation doublearrowproperties1-94 102. GraphicsAnnotation Ellipse Properties Define annotation ellipse propertiesAnnotation Line Properties Define annotation line propertiesAnnotation Rectangle Properties Define annotation rectanglepropertiesAnnotation Textarrow Properties Define annotation textarrowpropertiesAnnotation Textbox Properties Define annotation textbox propertiesAreaseries Properties Define areaseries propertiesBarseries Properties Define barseries propertiesContourgroup Properties Define contourgroup propertiesErrorbarseries Properties Define errorbarseries propertiesImage Properties Define image propertiesLineseries Properties Define lineseries propertiesQuivergroup Properties Define quivergroup propertiesScattergroup Properties Define scattergroup propertiesStairseries Properties Define stairseries propertiesStemseries Properties Define stemseries propertiesSurfaceplot Properties Define surfaceplot propertiesFigure Windowsclf Clear current figure windowclose Remove specified figureclosereq Default figure close request functiondrawnow Flushes event queue and updatesfigure windowgcf Current figure handlehgload Load Handle Graphics objecthierarchy from file1-95 103. 1 Functions By Categoryhgsave Save Handle Graphics objecthierarchy to filenewplot Determine where to draw graphicsobjectsopengl Control OpenGL renderingrefresh Redraw current figuresaveas Save figure or Simulink blockdiagram using specified formatAxes Operationsaxis Axis scaling and appearancebox Axes bordercla Clear current axesgca Current axes handlegrid Grid lines for 2-D and 3-D plotsishold Current hold statemakehgtform Create 4-by-4 transform matrixOperating on Object Propertiesget Query object propertieslinkaxes Synchronize limits of specified 2-Daxeslinkprop Keep same value for correspondingpropertiesrefreshdata Refresh data in graph when datasource is specifiedset Set object properties1-96 104. 3-D Visualization3-D VisualizationSurface and Mesh Plots (p. 1-97) Plot matrices, visualize functions oftwo variables, specify colormapView Control (p. 1-99) Control the camera viewpoint,zooming, rotation, aspect ratio, setaxis limitsLighting (p. 1-101) Add and control scene lightingTransparency (p. 1-101) Specify and control objecttransparencyVolume Visualization (p. 1-102) Visualize gridded volume dataSurface and Mesh PlotsCreating Surfaces and Meshes(p. 1-97)Visualizing gridded and triangulateddata as lines and surfacesDomain Generation (p. 1-98) Gridding data and creating arraysColor Operations (p. 1-98) Specifying, converting, andmanipulating color spaces,colormaps, colorbars, andbackgroundsColormaps (p. 1-99) Built-in colormaps you can useCreating Surfaces and Mesheshidden Remove hidden lines from mesh plotmesh, meshc, meshz Mesh plotspeaks Example function of two variablessurf, surfc 3-D shaded surface plotsurface Create surface objectsurfl Surface plot with colormap-basedlighting1-97 105. 1 Functions By Categorytetramesh Tetrahedron mesh plottrimesh Triangular mesh plottriplot 2-D triangular plottrisurf Triangular surface plotDomain Generationgriddata Data griddingmeshgrid Generate X and Y arrays for 3-D plotsColor Operationsbrighten Brighten or darken colormapcaxis Color axis scalingcolorbar Colorbar showing color scalecolordef Set default property values todisplay different color schemescolormap Set and get current colormapcolormapeditor Start