Вы находитесь на странице: 1из 87

Getting Started with MATLAB

MATLAB Product Description


System Requirements

Tutorials
Desktop Basics
Matrices and Arrays
Array Indexing
Workspace Variables
Character Strings
Calling Functions
2-D and 3-D Plots
Programming and Scripts
Help and Documentation

Language Fundamentals
Entering CommandsBuild and run MATLAB statements

Examples and How To


Enter Statements in Command Window
Format Output in Command Window
Call Functions
Continue Long Statements on Multiple Lines
Create Shortcuts to Rerun Commands
Stop Execution
Find Functions to Use
Find Text in Command Window or History
Check Syntax As You Type
Write to a Diary File
Concepts
Variable Names
Case and Space Sensitivity
Command vs. Function Syntax
Command History
Set Command Window Preferences
Set Keyboard Preferences
Troubleshooting
Common Errors When Calling Functions
Matrices and ArraysArray indexing, concatenation, sorting, and reshaping; set and bit-wise
operations
Start HereFor an overview of matrix and array manipulation, watch Working with Arrays.
Array Creation and Concatenation
Create or combine scalars, vectors, matrices, or arrays
Indexing
Access array elements
Array Dimensions
Determine array size or shape
Sorting and Reshaping Arrays
Sort, rotate, permute, reshape, or shift array contents
Array Creation and ConcatenationCreate or combine scalars, vectors, matrices, or arrays
Examples and How To
Create Numeric Arrays
Creating and Concatenating Matrices
IndexingAccess array elements
Examples and How To
Matrix Indexing
Access Data Using Categorical Arrays
Access Data in a Table
Access Data in a Structure Array
Access Data in a Cell Array
Array DimensionsDetermine array size or shape
Sorting and Reshaping ArraysSort, rotate, permute, reshape, or shift array contents

Examples and How To


Creating and Concatenating Matrices
Resizing and Reshaping Matrices
Shifting and Sorting Matrices
Operating on Diagonal Matrices
Empty Matrices, Scalars, and Vectors
Multidimensional Arrays

Operators and Elementary OperationsArithmetic, relational, logical, set, and bit-wise

operations
Arithmetic
Addition, subtraction, multiplication, division, power, rounding
Relational Operations
Value comparisons
Logical Operations
True or false (Boolean) conditions
Set Operations
Unions, intersection, set membership
Bit-Wise Operations
Set, shift, or compare specific bit fields
ArithmeticAddition, subtraction, multiplication, division, power, rounding
Concepts
Array vs. Matrix Operations
Operator Precedence
Floating-Point Numbers
Integers
Relational OperationsValue comparisons
Concepts
Relational Operators
Operator Precedence
Logical OperationsTrue or false (Boolean) conditions
Start HereThe logical data type represents true or false states using the numbers 1 and 0, respectively.
Certain MATLAB functions and operators return logical values to indicate fulfillment of a condition. You
can use those logical values to index into an array or execute conditional code. For more information,
see how to Find Array Elements That Meet a Condition.
Examples and How To
Find Array Elements That Meet a Condition
Determine if Arrays Are Logical
Reduce Logical Arrays to Single Value
Concepts
Operator Precedence
Truth Table for Logical Operations
Related Information
Bit-Wise Operations
Relational Operations
Set OperationsUnions, intersection, set membership
Bit-Wise OperationsSet, shift, or compare specific bit fields

Special CharactersSymbols

Concepts
Special Values
Symbol Reference
Data TypesNumeric arrays, character arrays, tables, structures, and cell arrays; data type conversion
Start HereBy default, MATLAB stores all numeric variables as double-precision floating-point values.
Additional data types store text, integer or single-precision values, or a combination of related data in a
single variable. For more information , see Fundamental MATLAB Classes or watch Introducing MATLAB
Fundamental Classes (Data Types).
Numeric Types
Integer and floating-point data
Characters and Strings
Text in character arrays
Categorical Arrays
Arrays of qualitative data with values from a finite set of discrete, nonnumeric data
Tables
Arrays in tabular form whose named columns can have different types
Structures
Arrays with named fields that can contain data of varying types and sizes
Cell Arrays
Arrays that can contain data of varying types and sizes
Function Handles
Variables that allow you to invoke a function indirectly
Map Containers
Objects with keys that index to values, where keys need not be integers
Time Series
Data vectors sampled over time
Data Type Identification
Determining data type of a variable
Data Type Conversion
Converting between numeric arrays, character arrays, cell arrays, structures, or tables
Numeric TypesInteger and floating-point data
Examples and How To
Overview of Numeric Classes
Integers
Floating-Point Numbers
Complex Numbers
Infinity and NaN
Identifying Numeric Classes
Display Format for Numeric Values
Combining Unlike Integer Types
Combining Integer and Noninteger Data
Empty Matrices
Concatenation Examples
Characters and StringsText in character arrays
Create and Concatenate Strings
Store text in character arrays, combine character arrays
Parse Strings

Identify parts of strings, find and replace substrings


Compare Strings
Determine if strings or parts of strings are equal
Change String Case, Blanks, and Justification
Change to upper- or lowercase, create or remove white space
Create and Concatenate StringsStore text in character arrays, combine character arrays
Examples and How To
Creating Character Arrays
Cell Arrays of Strings
Formatting Strings
Parse StringsIdentify parts of strings, find and replace substrings
Examples and How To
Searching and Replacing
Concepts
Regular Expressions
Lookahead Assertions in Regular Expressions
Tokens in Regular Expressions
Dynamic Regular Expressions
Compare StringsDetermine if strings or parts of strings are equal
Examples and How To
String ComparisonsChange String Case, Blanks, and Justification
Change to upper- or lowercase, create or remove white space
Categorical ArraysArrays of qualitative data with values from a finite set of discrete, nonnumeric data
Start Here
categorical is a data type to store data with values from a finite set of discrete categories. These
categories can have a natural order, but it is not required. A categorical array provides efficient storage
and convenient manipulation of nonnumeric data, while also maintaining meaningful names for the
values. You can use categorical arrays in a table to select groups of rows. For more information see
Create Categorical Arrays or watch Tables and Categorical Arrays.
Examples and How To
Create Categorical Arrays
Convert Table Variables Containing Strings to Categorical
Compare Categorical Array Elements
Combine Categorical Arrays
Plot Categorical Data
Access Data Using Categorical Arrays
Work with Protected Categorical Arrays
Concepts
Advantages of Using Categorical Arrays
Ordinal Categorical Arrays
Other MATLAB Functions Supporting Categorical Arrays
TablesArrays in tabular form whose named columns can have different types
Start Here
table is a data type suitable for column-oriented or tabular data that is often stored as columns in a text
file or in a spreadsheet. Tables consist of rows and column-oriented variables. Each variable in a table
can have a different data type and a different size with the one restriction that each variable must have
the same number of rows. For more information, see Create a Table or watch Tables and Categorical
Arrays.

Examples and How To


Create a Table
Add and Delete Table Rows
Add and Delete Table Variables
Clean Messy and Missing Data in Tables
Modify Units, Descriptions and Table Variable Names
Access Data in a Table
Calculations on Tables
Convert Table Variables Containing Strings to Categorical
Concepts
Advantages of Using Tables
Related Information
Array Dimensions
StructuresArrays with named fields that can contain data of varying types and sizes
Start Here
A structure array is a data type that groups related data using data containers called fields. Each field
can contain any type of data. Access data in a structure using dot notation of the form
structName.fieldName. For more information, see Create a Structure Array.
Examples and How To
Create a Structure Array
Access Data in a Structure Array
Concatenate Structures
Generate Field Names from Variables
Access Data in Nested Structures
Access Elements of a NonscalarStruct Array
Concepts
Cell vs. Struct Arrays
Ways to Organize Data in Structure Arrays
Memory Requirements for a Structure Array
Cell ArraysArrays that can contain data of varying types and sizes
Start Here
A cell array is a data type with indexed data containers called cells, where each cell can contain any type
of data. Cell arrays commonly contain either lists of text strings, combinations of text and numbers, or
numeric arrays of different sizes. Refer to sets of cells by enclosing indices in smooth parentheses, ().
Access the contents of cells by indexing with curly braces, {}. For more information, see Access Data in a
Cell Array.
Examples and How To
Create a Cell Array
Access Data in a Cell Array
Add Cells to a Cell Array
Delete Data from a Cell Array
Combine Cell Arrays
Pass Contents of Cell Arrays to Functions
Preallocate Memory for a Cell Array
Concepts
What Is a Cell Array?
Cell vs. Struct Arrays

Combining Cell Arrays with Non-Cell Arrays


Multilevel Indexing to Access Parts of Cells
Map ContainersObjects with keys that index to values, where keys need not be integers
Examples and How To
Overview of the Map Data Structure
Description of the Map Class
Creating a Map Object
Examining the Contents of the Map
Reading and Writing Using a Key Index
Modifying Keys and Values in the Map
Mapping to Different Value Types
Time SeriesData vectors sampled over time
Time Series Basics
Create and combine timeseries objects, query and set properties, plot time series data
Data Manipulation
Add or delete data, manipulate timeseries objects
Event Data
Add or delete events, create new timeseries objects based on event data
Descriptive Statistics
Descriptive statistics for timeseries objects
Time Series Collections
Query and set tscollection object properties, plot tscollection objects
Time Series BasicsCreate and combine timeseries objects, query and set properties, plot time series
data
Concepts
Introduction
Time Series Objects
Data ManipulationAdd or delete data, manipulate timeseries objects
Event DataAdd or delete events, create new timeseries objects based on event data
Descriptive StatisticsDescriptive statistics for timeseries objects
Examples and How To
Descriptive Statistics
Time Series CollectionsQuery and set tscollection object properties, plot tscollection objects
Data Type IdentificationDetermining data type of a variable
Concepts
Fundamental MATLAB Classes
Data Type ConversionConverting between numeric arrays, character arrays, cell arrays, structures, or
tables
Examples and How To
Converting from String to Numeric
Converting from Numeric to String
Concepts
Valid Combinations of Unlike Classes
Dates and TimeCurrent time, elapsed time, date formats
Examples and How To
Represent Dates and Times in MATLAB
Compute Elapsed Time

Concepts
Carryover in Date Vectors and Strings
Troubleshooting
Troubleshooting: Converting Date Vector Returns Unexpected Output

Mathematics
Elementary MathTrigonometry, exponentials and logarithms, complex values, rounding,

remainders, discrete math, coordinate system conversion


Arithmetic
Addition, subtraction, multiplication, division, power, rounding
Trigonometry
Sine, cosine, and related functions, with results in radians or degrees
Exponents and Logarithms
Exponential, logarithm, power, and root functions
Complex Numbers
Real and imaginary components, phase angles
Discrete Math
Prime factors, factorials, permutations, rational fractions, least common multiple, greatest common
divisor
Polynomials
Curve fitting, roots, partial fraction expansions
Special Functions
Bessel, Legendre, elliptic, error, gamma, and other functions
Cartesian Coordinate System Conversion
Cartesian, polar, and spherical coordinates
Constants and Test Matrices
Pi, Not-a-Number, infinity; Hadamard, Companion, Pascal, and other specialized matrices
ArithmeticAddition, subtraction, multiplication, division, power, rounding
Concepts
Array vs. Matrix Operations
Operator Precedence
Floating-Point Numbers
Integers
TrigonometrySine, cosine, and related functions, with results in radians or degrees
Exponents and LogarithmsExponential, logarithm, power, and root functions
Examples and How To
Powers and Exponentials
Complex NumbersReal and imaginary components, phase angles
Examples and How To
Plot Imaginary and Complex Data
Discrete MathPrime factors, factorials, permutations, rational fractions, least common multiple,
greatest common divisor
PolynomialsCurve fitting, roots, partial fraction expansions
Examples and How To
Representing Polynomials
Evaluating Polynomials
Roots of Polynomials
Derivatives

Partial Fraction Expansions


Characteristic Polynomials
Polynomial Curve Fitting
Special FunctionsBessel, Legendre, elliptic, error, gamma, and other functions
Cartesian Coordinate System ConversionCartesian, polar, and spherical coordinates
Constants and Test MatricesPi, Not-a-Number, infinity; Hadamard, Companion, Pascal, and other
specialized matrices
Examples and How To
Missing Data
Linear AlgebraMatrix analysis, linear equations, eigenvalues, singular values, logarithms,
exponentials, factorization
Matrix Operations
Cross and dot products, transpose
Linear Equations
Solve linear systems, least squares
Matrix Decomposition
Cholesky, LU, and QR factorizations, diagonal forms, singular value decomposition
Eigenvalues and Singular Values
Eigenvalues, eigenvectors, Schur decomposition, Hessenburg matrices, etc.
Matrix Analysis
Norm, rank, determinant, condition, structure
Matrix Functions
Logarithms, exponentials, roots, other functions
Matrix OperationsCross and dot products, transpose
Examples and How To
Matrices in the MATLAB Environment
Linear EquationsSolve linear systems, least squares
Examples and How To
Systems of Linear Equations
Matrix DecompositionCholesky, LU, and QR factorizations, diagonal forms, singular value
decomposition
Examples and How To
Factorizations
Eigenvalues and Singular ValuesEigenvalues, eigenvectors, Schur decomposition, Hessenburg
matrices, etc.
Examples and How To
Eigenvalues
Singular Values
Matrix AnalysisNorm, rank, determinant, condition, structure
Examples and How To
Inverses and Determinants
Matrix FunctionsLogarithms, exponentials, roots, other functions

Statistics and Random NumbersDescriptive statistics, random number generation


Descriptive Statistics
Range, central tendency, standard deviation, variance, correlation
Random Number Generation

Seeds, distributions, algorithms


Descriptive StatisticsRange, central tendency, standard deviation, variance, correlation
Examples and How To
Descriptive Statistics
Inconsistent Data
Filtering Data
Detrending Data
Linear Correlation
Linear Regression
Interactive Fitting
Programmatic Fitting
Random Number GenerationSeeds, distributions, algorithms
Start Here
Use the rand, randn, and randi functions to create sequences pseudorandom numbers. Use the rng
function to control the repeatability of your results. Use the RandStream class when you need more
advanced control over random number generation.
Examples and How To
Generate Random Numbers
Create Arrays of Random Numbers
Random Numbers within a Specific Range
Random Integers
Random Numbers from Normal Distribution with Specific Mean and Variance
Random Numbers Within a Sphere
Replace Discouraged Syntaxes of rand and randn
Control Random Number Generation
Generate Random Numbers That Are Repeatable
Generate Random Numbers That Are Different
Control Multiple Streams or Substreams
Managing the Global Stream
Multiple streams
Creating and Controlling a Random Number Stream
Concepts
Random Numbers in MATLAB
Why Do Random Numbers Repeat After Startup?
Related Information
Controlling Random Number Generation (5 min, 54 sec)
InterpolationData interpolation, data gridding, polynomial evaluation, nearest point search
1-D Interpolation
Interpolation of 1-D data
Gridded Data Interpolation
Interpolation of uniformly sampled data in 2-D, 3-D, N-D
Scattered Data Interpolation
Interpolation of scattered data
1-D InterpolationInterpolation of 1-D data
Examples and How To
Interpolation of Multiple 1-D Value Sets
Gridded Data InterpolationInterpolation of uniformly sampled data in 2-D, 3-D, N-D

Examples and How To


Interpolating Gridded Data
Interpolation of 2-D Selections in 3-D Grids
Concepts
Gridded and Scattered Sample Data
Scattered Data InterpolationInterpolation of scattered data
Examples and How To
Interpolating Scattered Data
Extrapolating Scattered Data
Interpolation Using a Specific Delaunay Triangulation
Concepts
Gridded and Scattered Sample Data
OptimizationMinimum of single and multivariable functions, nonnegative least-squares constraint
problems
Examples and How To
Function Summary
Minimizing Functions of One Variable
Minimizing Functions of Several Variables
Maximizing Functions
Optimizing Nonlinear Functions
fminsearch Algorithm
Curve Fitting via Optimization
Set Options
Iterative Display
Output Functions
Plot Functions
Roots of Scalar Functions
Troubleshooting and Tips
Reference
Numerical Integration and Differential Equations Numerical integration, ordinary
differential equations, partial differential equations, boundary value problems
Ordinary Differential Equations
Ordinary differential equation initial value problem solvers
Boundary Value Problems
Boundary value problem solvers for ordinary differential equations
Delay Differential Equations
Delay differential equation initial value problem solvers
Partial Differential Equations
1-D Parabolic-elliptic PDEs, initial-boundary value problem solver
Numerical Integration and Differentiation
Quadratures, double and triple integrals, and multidimensional derivatives
Boundary Value ProblemsBoundary value problem solvers for ordinary differential equations
Examples and How To
Boundary-Value Problems
Delay Differential EquationsDelay differential equation initial value problem solvers
Examples and How To
DDE with Constant Delays

State-Dependent Delay Problem


Cardiovascular Model with Discontinuities
DDE of Neutral Type
Initial Value DDE of Neutral Type
Concepts
Types of DDEs
Discontinuities in DDEs
Partial Differential Equations1-D Parabolic-elliptic PDEs, initial-boundary value problem solver
Examples and How To
Partial Differential Equations
Numerical Integration and DifferentiationQuadratures, double and triple integrals, and
multidimensional derivatives
Examples and How To
Integration to Find Arc Length
Complex Line Integrals
Singularity on Interior of Integration Domain
Analytic Solution to Integral of Polynomial
Integration of Numeric Data
Fourier Analysis and FilteringFourier transforms, convolution, digital filtering
Examples and How To
Discrete Fourier Transform (DFT)
Fast Fourier Transform (FFT)
Filtering Data
Detrending Data
Convolution
Sparse MatricesElementary sparse matrices, reordering algorithms, iterative methods, tree
operations
Sparse Matrix Creation
Random and nonrandom sparse matrices
Sparse Matrix Manipulation
Allocate, get information about matrices, process nonzero elements, visualize sparsity pattern
Reordering Algorithms
Random, column, minimum degree, Dulmage-Mendelsohn, and reverse Cuthill-McKee permutations
Sparse Linear Algebra
Norms, eigenvalues, factorizations, least squares, structural rank
Linear Equations (Iterative Methods)
Methods for conjugate and biconjugate gradients, residuals, lower quartile
Graph and Tree Algorithms
Elimination trees, tree plotting, factorization analysis
Sparse Matrix CreationRandom and nonrandom sparse matrices
Examples and How To
Full and Sparse Matrices
Constructing Sparse Matrices
Computational Advantages
Sparse Matrix ManipulationAllocate, get information about matrices, process nonzero elements,
visualize sparsity pattern
Examples and How To

Accessing Sparse Matrices


Sparse Matrix Operations
Selected Bibliography
Reordering AlgorithmsRandom, column, minimum degree, Dulmage-Mendelsohn, and reverse CuthillMcKee permutations
Sparse Linear AlgebraNorms, eigenvalues, factorizations, least squares, structural rank
Linear Equations (Iterative Methods)Methods for conjugate and biconjugate gradients, residuals,
lower quartile
Graph and Tree AlgorithmsElimination trees, tree plotting, factorization analysis
Computational GeometryTriangulation, convex hulls, Voronoi diagrams
Triangulation Representation
Represent and query triangulations
Delaunay Triangulation
Delaunay triangulation, triangular surface and mesh plots
Spatial Search
Delaunay-based nearest-neighbor and point location searches, barycentric coordinates
Convex Hull
Plot convex hull, plotting functions
Voronoi Diagram
Plot Voronoi diagram, patch graphics object, plotting functions
Elementary Polygons
Basic polygon functions
Triangulation RepresentationRepresent and query triangulations
Examples and How To
Triangulation Representations
Delaunay TriangulationDelaunay triangulation, triangular surface and mesh plots
Examples and How To
Delaunay Triangulation
Spatial SearchDelaunay-based nearest-neighbor and point location searches, barycentric coordinates
Examples and How To
Spatial Searching
Convex HullPlot convex hull, plotting functions
Examples and How To
Convex Hulls
Voronoi DiagramPlot Voronoi diagram, patch graphics object, plotting functions
Examples and How To
Voronoi Diagrams
Elementary PolygonsBasic polygon functions

Graphics
2-D and 3-D PlotsPlot continuous, discrete, surface, and volume data
Plotting Basics
Plot types, workflows
Line Plots
Linear, log-log, semi-log, error bar plots
Pie Charts, Bar Plots, and Histograms
Proportion and distribution of data

Discrete Data Plots


Stem, stair, scatter plots
Polar Plots
Plots in polar coordinates
Contour Plots
2-D and 3-D isoline plots
Vector Fields
Comet, compass, feather, quiver and stream plots
Surfaces, Volumes, and Polygons
Gridded surface and volume data, ungridded polygon data
Animation
Animating plots
Plotting BasicsPlot types, workflows
Examples and How To
Programmatic Workflow
Create 2-D Graph and Customize Lines
Add Title, Axis Labels, and Legend to Graph
Change Axis Limits of Graph
Change Tick Marks and Tick Labels of Graph
Add Plot to Existing Graph
Create Figure With Multiple Graphs Using Subplots
Create Graph with Two y-Axes
Tools Workflow
Create Graph Using Plots Tab
Customize Graph Using Plot Tools
Create Subplots Using Plot Tools
Concepts
Types of MATLAB Plots
Related Information
Gallery of Plotting Examples
Line PlotsLinear, log-log, semi-log, error bar plots
Examples and How To
Create 2-D Graph and Customize Lines
Create Graph with Two y-Axes
Display Markers at Specific Data Points on Line Graph
Change Default Line Style and Color Orders
Plot Imaginary and Complex Data
Related Information
1-D Interpolation
Pie Charts, Bar Plots, and HistogramsProportion and distribution of data
Examples and How To
Modify Baseline of Bar Graph
Overlay Bar Graphs
Overlay Line Plot on Bar Graph Using Two y-Axes
Color 3-D Bars by Height
Compare Data Sets Using Overlayed Area Graphs
Offset Pie Slice with Greatest Contribution

Add Legend to Pie Chart


Label Pie Chart With Text and Percent Values
Concepts
Types of Bar Graphs
Data Cursors with Histograms
Discrete Data PlotsStem, stair, scatter plots
Examples and How To
Combine Stem Plot and Line Plot
Combine Stairstep Plot and Line Plot
Interpolating Scattered Data
Related Information
Scattered Data Interpolation
Polar PlotsPlots in polar coordinates
Examples and How To
Contour Plot in Polar Coordinates
Contour Plots2-D and 3-D isoline plots
Examples and How To
Label Contour Plot Levels
Change Fill Colors for Contour Plot
Highlight Specific Contour Levels
Contour Plot in Polar Coordinates
Smooth Contour Data with Convolution Filter
Concepts
The Contouring Algorithm
Related Information
Gridded Data Interpolation
Vector FieldsComet, compass, feather, quiver and stream plots
Examples and How To
Display Quiver Plot Over Contour Plot
Projectile Path Over Time
Stream Line Plots of Vector Data
Surfaces, Volumes, and PolygonsGridded surface and volume data, ungridded polygon data
Surface and Mesh Plots
Representing gridded data as surface and mesh plots
Volume Visualization
Representing gridded volume data as iso, slice, and stream plots
Polygons
Shaded polygons
Surface and Mesh PlotsRepresenting gridded data as surface and mesh plots
Examples and How To
Representing Data as a Surface
Coloring Mesh and Surface Plots
Gridded Data Interpolation
Volume VisualizationRepresenting gridded volume data as iso, slice, and stream plots
Examples and How To
Exploring Volumes with Slice Planes
Connecting Equal Values with Isosurfaces

Isocaps Add Context to Visualizations


Stream Line Plots of Vector Data
Displaying Curl with Stream Ribbons
Displaying Divergence with Stream Tubes
Creating Stream Particle Animations
Vector Field Displayed with Cone Plots
Gridded Data Interpolation
Concepts
Overview of Volume Visualization
Techniques for Visualizing Scalar Volume Data
Visualizing Vector Volume Data
PolygonsShaded polygons
Examples and How To
Multifaceted Patches
Modifying Data on Existing Patch Objects
Specifying Patch Coloring
Interpreting Indexed and Truecolor Data
Concepts
Introduction to Patch Objects
AnimationAnimating plots
Examples and How To
Creating Stream Particle Animations
Animation
Formatting and AnnotationGraph annotation, color mapping, axis limits and scaling, data
exploration, lighting, transparency, and camera views
Titles and Labels
Legend, label, graph title
Coordinate System
Axis limits, aspect ratio, decorations, multiple-axis plots
Annotation
Informative text and symbols added to graphs
Colormaps
Specification, modification, and conversion of colormaps
Data Exploration
Techniques to enhance visual display of information
Data Brushing
Interactively mark, delete, modify and save observations in graphs
3-D Scene Control
Camera views, lighting, and transparency
Titles and LabelsLegend, label, graph title
Examples and How To
Programmatic Workflow
Add Title, Axis Labels, and Legend to Graph
Specify Objects to Include in Legend
One Legend Entry for Group of Objects
Specify Legend Descriptions During Line Creation
Change Colorbar Width

Change Scaling of Data Values into the Colormap


Tools Workflow
Add Title to Graph Using Plot Tools
Add Axis Labels to Graph Using Plot Tools
Add Legend to Graph Using Plot Tools
Add Colorbar to Graph Using Plot Tools
Concepts
Control Legend Content
Coordinate SystemAxis limits, aspect ratio, decorations, multiple-axis plots
Examples and How To
Change Axis Limits of Graph
Add Plot to Existing Graph
Place Text Outside the Axes
Display Data Using Different Scalings
Concepts
Axes Objects Defining Coordinate Systems for Graphs
Axes Position
Automatic Axes Resize
Aspect Ratio for 2-D Axes
Understanding Axes Aspect Ratio
AnnotationInformative text and symbols added to graphs
Examples and How To
Tools Workflow
How to Annotate Graphs
Alignment Tool Aligning and Distributing Objects
Adding Arrows and Lines to Graphs
Programmatic Workflow
Adding Text to Graphs
Vertical Distribute, Horizontal Align
Pinning a Point in the Graph
Concepts
Annotation Objects
ColormapsSpecification, modification, and conversion of colormaps
Examples and How To
Add Colorbar to Graph Using Plot Tools
Coloring Mesh and Surface Plots
Specifying Patch Coloring
Interpreting Indexed and Truecolor Data
Data ExplorationTechniques to enhance visual display of information
Examples and How To
Ways to Explore Graphical Data
Data Cursor Displaying Data Values Interactively
Zooming in Graphs
Panning Shifting Your View of the Graph
Rotate in 3-D
Concepts
What Is Interactive Data Exploration?

Data BrushingInteractively mark, delete, modify and save observations in graphs


Examples and How To
Data Cursor Displaying Data Values Interactively
Marking Up Graphs with Data Brushing
Making Graphs Responsive with Data Linking
Concepts
Interacting with Graphed Data
3-D Scene ControlCamera views, lighting, and transparency
Camera Views
View point positioning
Lighting and Transparency
Light sources and object transparency
Camera ViewsView point positioning
Start Here
To understand the MATLAB viewing model, see View Overview.
Examples and How To
Tools Workflow
Zooming in Graphs
Panning Shifting Your View of the Graph
Rotate in 3-D
View Control with the Camera Toolbar
Programmatic Workflow
Setting the Viewpoint with Azimuth and Elevation
Dollying the Camera
Moving the Camera Through a Scene
Manipulating Axes Aspect Ratio
Concepts
Default Viewpoint Selection
Understanding Axes Aspect Ratio
Camera Graphics Terminology
Understanding View Projections
Low-Level Camera Properties
Lighting and TransparencyLight sources and object transparency
Examples and How To
Selecting a Lighting Method
Reflectance Characteristics of Graphics Objects
Making Objects Transparent
Mapping Data to Transparency Alpha Data
Selecting an Alphamap
Concepts
Lighting Overview
ImagesImage file read, write, display and conversion
Image File Operations
Image file read, display, modify and write
Modifying Images
Image type conversion, colormap modification
Image File OperationsImage file read, display, modify and write

Start Here
MATLAB images are arrays of numeric data on which you can perform analysis. See Working with
Images in MATLAB Graphics.
Examples and How To
Read, Write, and Query Image Files
8-Bit and 16-Bit Images
Displaying Graphics Images
The Image Object and Its Properties
Printing Images
Convert Image Graphic or Data Type
Modifying ImagesImage type conversion, colormap modification
Concepts
Image Types
Printing and ExportingStandard file format print and export
Examples and How To
How to Print or Export
Printing and Exporting Use Cases
Changing a Figure's Settings
Choosing a Graphics Format
Choosing a Printer Driver
Saving Your Work
Troubleshooting
Concepts
Overview of Printing and Exporting
Graphics ObjectsGraphics objects, properties, and identification
Start Here
Manipulate graphics objects to create customized graphs. To understand the organization of graphics
objects, see Organization of Graphics Objects.
Graphics Object Identification
Find and manipulate graphics objects via their handles
Core Objects
Basic drawing primitives used by graphing functions
Annotation Objects
Graph annotation objects
Plot Objects
Property descriptions for plot objects
Group Objects
Group manipulation of objects
Figure Windows
Graphics window creation and identification
Axes Property Operations
Line styles, colors, colormaps, scaling, multiple axes
Object Property Operations
Object property query, set, and link operations
Graphics Object IdentificationFind and manipulate graphics objects via their handles
Examples and How To
Graphics Windows the Figure

Accessing Object Handles


Controlling Graphics Output
Optimizing Graphics Performance
Core ObjectsBasic drawing primitives used by graphing functions
Concepts
Core Graphics Objects
Annotation ObjectsGraph annotation objects
Examples and How To
Annotation Objects
Plot ObjectsProperty descriptions for plot objects
Examples and How To
Plot Objects
Group ObjectsGroup manipulation of objects
Examples and How To
Group Objects
Transforming a Hierarchy of Objects
Grouping Objects Within Axes hgtransform
Figure WindowsGraphics window creation and identification
Start Here
Figure objects contain all objects displayed in graphs. See Figure Objects for an overview.
Examples and How To
Specifying the Target for Graphics Output
Docking Figures in the Desktop
Positioning Figures
Figure Colormaps TheColormap Property
Selecting Drawing Methods
Concepts
Graphics Windows the Figure
Axes Property OperationsLine styles, colors, colormaps, scaling, multiple axes
Start Here
Axes objects contain the lines, surfaces, and other objects that represent the data visualized in a graph.
See Axes Objects Defining Coordinate Systems for Graphs for an overview.
Examples and How To
Axes Position
Automatic Axes Resize
Display Data Using Different Scalings
Individual Axis Control
Graph with Multiple x-Axes and y-Axes
Automatic-Mode Properties
Colors Controlled by Axes
Axes Color Limits the CLim Property
Defining the Color of Lines for Plotting
Object Property OperationsObject property query, set, and link operations
Examples and How To
Object Properties
Setting and Querying Property Values
Factory-Defined Property Values

Setting Default Property Values


Accessing Object Handles
Saving Handles in Files
Properties Changed by Built-In Functions
Linking Graphs to Variables Data Source Properties
Optimizing Graphics Performance
Callback Properties for Graphics Objects
Function Handle Callbacks

Programming Scripts and Functions


Control FlowConditional statements, loops, branching

Concepts
Conditional Statements
Loop Control Statements
ScriptsBasic program files
Examples and How To
Create Scripts
Add Comments to Programs
Run Code Sections
Document and Share Code Using Examples
Create a MATLAB Notebook with Microsoft Word
Concepts
Scripts vs. Functions
Options for Presenting Your Code
Publishing MATLAB Code
Publishing Markup
Output Preferences for Publishing
Related Information
Publishing Code from the Editor (5 min, 57 sec)
FunctionsPrograms that accept inputs and return outputs
Function Basics
Create functions, including anonymous, local, and nested functions
Input and Output Arguments
Support variable length argument lists, check arguments
Variables
Share data between functions or workspaces, generate valid variable names
Error Handling
Generate, catch, and respond to warnings and errors
Function BasicsCreate functions, including anonymous, local, and nested functions
Examples and How To
Create Functions in Files
Add Help for Your Program
Run Functions in the Editor
Concepts
Types of Functions
Anonymous Functions
Local Functions

Nested Functions
Private Functions
Function Precedence Order
Troubleshooting
Variables in Nested and Anonymous Functions
Related Information
Writing a MATLAB Program (4 min, 57 sec)
Input and Output ArgumentsSupport variable length argument lists, check arguments
Examples and How To
Find Number of Function Arguments
Support Variable Number of Inputs
Support Variable Number of Outputs
Validate Number of Function Arguments
Ignore Function Inputs
Check Function Inputs with validateattributes
Parse Function Inputs
Concepts
Argument Checking in Nested Functions
Input Parser Validation Functions
VariablesShare data between functions or workspaces, generate valid variable names
Examples and How To
Share Data Between Workspaces
Check Variable Scope in Editor
Concepts
Variable Names
Base and Function Workspaces
Error HandlingGenerate, catch, and respond to warnings and errors
Examples and How To
Issue Warnings and Errors
Suppress Warnings
Restore Warnings
Change How Warnings Display
Use try/catch to Handle Errors
Clean Up When Functions Complete
DebuggingDiagnose problems with MATLAB programs
Examples and How To
Ways to Debug MATLAB Files
Preparing for Debugging
Set Breakpoints
Run a File with Breakpoints
Step Through a File
Examine Values
Correct Problems and End Debugging
Conditional Breakpoints
Breakpoints in Anonymous Functions
Breakpoints in Methods That Overload Functions
Error Breakpoints

Coding and Productivity TipsEdit and run program files

Examples and How To


Open and Save Files
Add Comments to Programs
Check Syntax As You Type
Check Code for Errors and Warnings
Improve Code Readability
Find and Replace Text in Files
Go To Location in File
Display Two Parts of a File Simultaneously
Add Reminders to Files
Change Default Editor
Concepts
Colors in the MATLAB Editor
Code Contains %#ok What Does That Mean?
MATLAB Code Analyzer Report
Editor/Debugger Preferences
Code Analyzer Preferences
Programming UtilitiesExecute expressions or functions, determine dependencies, protect source
code
Examples and How To
Identify Program Dependencies
Protect Your Source Code
Use a MATLAB Timer Object
Create Hyperlinks that Run Functions
Concepts
Alternatives to the eval Function
Timer Callback Functions
Handling Timer Queuing Conflicts

Data and File Management


Workspace VariablesData in the MATLAB workspace
Examples and How To
Create Variables
View, Edit, and Copy Variables
View the Contents of a MAT-File
Save, Load, and Delete Workspace Variables
Load Parts of Variables from MAT-Files
Save Parts of Variables to MAT-Files
Save Structure Fields as Separate Variables
Concepts
What Is the MATLAB Workspace?
Statistical Calculations in the Workspace Browser
Keyboard Shortcuts for Navigating Variable Elements
Workspace and Variable Preferences
MAT-File Versions
Troubleshooting

Loading Variables within a Function


File Size Increases Unexpectedly When Growing Array
Data Import and ExportData import and export and low-level file I/O
Import and Export Basics
Functions that import and export multiple file types, supported file formats
Text Files
Delimited or formatted I/O to text files
Spreadsheets
Read and write data in spreadsheets
Low-Level File I/O
Read and write operations at the byte or character level
Images
Graphics files
Scientific Data
CDF, FITS, HDF formats
Audio and Video
Audio and video data files; audio recording and playback
XML Documents
Documents written in Extensible Markup Language
Memory Mapping
Access to files using MATLAB array indexing
Import and Export BasicsFunctions that import and export multiple file types, supported file formats
Start Here
The topics on this page provide an overview of import and export workflows. For information on the file
formats MATLAB supports, and the associated import and export functions, see Supported File Formats
for Import and Export.
Examples and How To
Methods for Importing Data
Import or Export a Sequence of Files
Import Images, Audio, and Video Interactively
Concepts
Supported File Formats for Import and Export
Related Information
Importing Data from Files Programmatically (3 min, 55 sec)
Text FilesDelimited or formatted I/O to text files
Examples and How To
Select Text File Data Using Import Tool
Import Numeric Data from Text Files
Import Mixed Text and Numeric Data from Text Files
Import Large Text File Data in Blocks
Import Data from a Nonrectangular Text File
Import Dates and Times from Text Files
Write to Delimited Data Files
Concepts
Ways to Import Text Files
Related Information

Importing Data from Text Files Interactively (6 min, 17 sec)


SpreadsheetsRead and write data in spreadsheets
Examples and How To
Select Spreadsheet Data Using Import Tool
Import a Worksheet or Range
Import All Worksheets from a File
Export to Excel Spreadsheets
Concepts
Ways to Import Spreadsheets
System Requirements for Importing Spreadsheets
When to Convert Dates from Excel Files
Related Information
Importing Spreadsheets (4 min, 34 sec)
Low-Level File I/ORead and write operations at the byte or character level
Examples and How To
Import Text Data Files with Low-Level I/O
Import Binary Data with Low-Level I/O
Export to Text Data Files with Low-Level I/O
Export Binary Data with Low-Level I/O
ImagesGraphics files
Examples and How To
Importing Images
Exporting to Images
Scientific DataCDF, FITS, HDF formats
netCDF Files
Network Common Data Form
HDF5 Files
Hierarchical Data Format, Version 5
HDF4 Files
Hierarchical Data Format, Version 4
FITS Files
Flexible Image Transport System
Band-Interleaved Files
Band-interleaved data
Common Data Format
CDF files
netCDF FilesNetwork Common Data Form
Examples and How To
Importing NetCDF Files and OPeNDAP Data
Exporting to NetCDF Files
HDF5 FilesHierarchical Data Format, Version 5
Start Here
High-level access functions make it easy to read a data set from an HDF5 file or write a variable from the
MATLAB workspace into an HDF5 file. Low-level functions provide direct access to the more than 300
functions in the HDF library. To create or write to nonnumeric datasets or attributes, you must use the
low-level functions.
High-Level Functions

Easily view, read, and write HDF5 files


Low-Level Functions
Interact directly with HDF5 library functions
HDF4 FilesHierarchical Data Format, Version 4
Start Here
High-level access functions make it easy to read a data set from an HDF4 or HDF-EOS file. Low-level
functions provide direct access to functions in the HDF4 library. You must use the low-level functions to
export data to an HDF4 file.
High-Level Functions
Easily view and read HDF4 files
Low-Level Functions
Interact directly with HDF4 library functions
FITS FilesFlexible Image Transport System
Start Here
High-level access functions make it easy to read data from a FITS file or write data from the MATLAB
workspace to a FITS file. Low-level functions provide direct access to more than 50 functions in the
CFITSIO library.
High-Level Functions
Easily view, read, and write FITS files
Low-Level Functions
Interact directly with CFITSIO library functions
Band-Interleaved FilesBand-interleaved data
Common Data FormatCDF files
Examples and How To
Importing CDF Files
Exporting to CDF Files
Audio and VideoAudio and video data files; audio recording and playback
Reading and Writing Files
Audio and video file I/O
Recording and Playback
Audio recording and playback
Utilities
Audio signal conversion
Reading and Writing FilesAudio and video file I/O
Examples and How To
Read and Get Information About Audio Files
Get Information about Video Files
Read Video Files
Convert Between Image Sequences and Video
Export to Audio and Video
Concepts
Characteristics of Audio Files
Supported Video File Formats
Recording and PlaybackAudio recording and playback
Examples and How To
Record and Play Audio
UtilitiesAudio signal conversion
XML DocumentsDocuments written in Extensible Markup Language

Examples and How To


Importing XML Documents
Exporting to XML Documents
Memory MappingAccess to files using MATLAB array indexing
Start Here
Memory-mapping is a mechanism that maps a file or a portion of a file on disk to a range of addresses
within an application's address space. Use memory-mapping when you want to randomly access large
files, or frequently access small files. In addition, memory-mapping lets you access file data using
standard MATLAB indexing operations. For more information, see Overview of Memory-Mapping.
Examples and How To
Map File to Memory
Read Mapped File
Write to Mapped File
Delete Memory Map
Share Memory Between Applications
Concepts
Overview of Memory-Mapping
File OperationsInteract with system files and folders
Files and Folders
View and change files and folders
File Name Construction
Path and file name information
File Compression
Zip and tar files; file compression and decompression
Files and FoldersView and change files and folders
Examples and How To
Find Files and Folders
Comparing Files and Folders
Manage Files and Folders
Concepts
Files and Folders that MATLAB Accesses
Current Folder Browser Preferences
MathWorks File Extensions
File Name ConstructionPath and file name information
Examples and How To
Specify File Names
Create Temporary Files
File CompressionZip and tar files; file compression and decompression
Examples and How To
Create and Extract from Zip Archives
Search PathView and change MATLAB search path
Start Here
The MATLAB search path is a subset of all the folders in the file system. MATLAB uses the search path to
efficiently locate files used with MathWorks products. For more information, see What Is the MATLAB
Search Path?
Examples and How To
Change Folders on the Search Path

Use Search Path with Different MATLAB Installations


Add Folders to Search Path Upon Startup
Assign userpath as Startup Folder (Macintosh or UNIX)
Concepts
What Is the MATLAB Search Path?
Files and Folders that MATLAB Accesses
Troubleshooting
Path Unsuccessfully Set at Startup
Errors When Updating Folders on Search Path
Operating System CommandsInteract with the operating system from MATLAB
Examples and How To
Shell Escape Functions
Run External Commands, Scripts, and Programs
Internet File AccessEmail, FTP, and URL downloads
Examples and How To
Downloading Web Content and Files
Sending Email
Performing FTP File Operations
Display Hyperlinks in the Command Window
Concepts
Web Browsers and MATLAB
Serial Port DevicesDevices connected to your computer's serial port
Examples and How To
Introduction
Overview of the Serial Port
Getting Started with Serial I/O
Creating a Serial Port Object
Connecting to the Device
Configuring Communication Settings
Writing and Reading Data
Events and Callbacks
Using Control Pins
Debugging: Recording Information to Disk
Saving and Loading
Disconnecting and Cleaning Up
Property Reference
Properties Alphabetical List
Hardware SupportAcquire data from Raspberry Pi hardware or Webcams
Raspberry Pi Hardware
Acquire data from Raspberry Pi hardware and peripherals
Webcams
Acquire image data from Webcams
Raspberry Pi HardwareAcquire data from Raspberry Pi hardware and peripherals
Install and Set Up Support for Raspberry Pi Hardware
Install and set up support for Raspberry Pi hardware
Create a Connection to Raspberry Pi Hardware
Create a connection to Raspberry Pi hardware

LEDs
Use the Raspberry Pi's LED
GPIO Pins
Use the Raspberry Pi's GPIO pins
Serial Port
Use the Raspberry Pi's serial port
I2C Interface
Use the Raspberry Pi's I2C interface
SPI Interface
Use the Raspberry Pi's SPI interface
Camera Board
Use the Raspberry Pi's add-on Camera Board
Linux
Use the Linux command shell and manage files on Raspberry Pi hardware
Install and Set Up Support for Raspberry Pi HardwareInstall and set up support for Raspberry Pi
hardware
How To
Install Support for Raspberry Pi Hardware
Open Interactive Examples
Create a Connection to Raspberry Pi HardwareCreate a connection to Raspberry Pi hardware
How To
Connect to Raspberry Pi Hardware
Concepts
Connecting to Raspberry Pi Hardware
Troubleshooting
Troubleshoot Connecting to Raspberry Pi Hardware
Get the IP Address of the Raspberry Pi Hardware
Guidelines for Entering Static IP Settings
LEDsUse the Raspberry Pi's LED
How To
Turn the Raspberry Pi LED On and Off
Flash the Raspberry Pi LED in Response to an Input
Concepts
The Raspberry Pi LED
GPIO PinsUse the Raspberry Pi's GPIO pins
How To
Use the Raspberry Pi GPIO Pins as Digital Inputs and Outputs
Concepts
The Raspberry Pi GPIO Pins
Troubleshooting
Troubleshoot Raspberry Pi GPIO Pins
Serial PortUse the Raspberry Pi's serial port
How To
Use the Raspberry Pi Serial Port to Connect to a Device
Concepts
The Raspberry Pi Serial Port
Troubleshooting
Troubleshoot the Raspberry Pi Serial Port

I2C InterfaceUse the Raspberry Pi's I2C interface


How To
Use the Raspberry Pi I2C Interface to Connect to a Device
Concepts
The Raspberry Pi I2C Interface
Troubleshooting
Troubleshoot the Raspberry Pi I2C Interface
SPI InterfaceUse the Raspberry Pi's SPI interface
How To
Use the Raspberry Pi SPI Interface to Connect to a Device
Concepts
The Raspberry Pi SPI Interface
Camera BoardUse the Raspberry Pi's add-on Camera Board
How To
Use the Raspberry Pi Camera Board to Capture Images and Video
Concepts
The Raspberry Pi Camera Board
Troubleshooting
Troubleshoot the Raspberry Pi Camera Board
LinuxUse the Linux command shell and manage files on Raspberry Pi hardware
How To
Run Linux Commands on Raspberry Pi Hardware
Manage Raspberry Pi Files
Concepts
The Raspberry Pi Linux Command Interface
Management of Raspberry Pi Files
Troubleshooting
Troubleshoot Managing Raspberry Pi Files
WebcamsAcquire image data from Webcams
Examples and How To
Connecting to Webcams
Acquiring Images from Webcams
Setting Properties for Webcam Acquisition
Installing the Webcam Support Package
Concepts
Webcam Acquisition Overview

GUI Building
GUI Building BasicsGraphical user interface building techniques, terminology
Examples and How To
Create a Simple GUIDE GUI
Create a Simple Programmatic GUI
Concepts
What Is a GUI?
How Does a GUI Work?
Ways to Build MATLAB GUIs
Files Generated by GUIDE
Structure of a Programmatic GUI File

GUIDE Templates
GUIDE Tools Summary
GUIDE Preferences
GUIDE Options
GUI Design References
Related Information
Creating a GUI with GUIDE (10 min, 28 sec)
Component SelectionGUI elements such as buttons, menus, and dialog boxes
GUI Controls and Indicators
Buttons, boxes, sliders, and text
Menus and Toolbars
Menu items and tools at the top of a window
Predefined Dialog Boxes
Dialog boxes to report status, gather user input, and interact with operating system or printers
GUI Controls and IndicatorsButtons, boxes, sliders, and text
Examples and How To
Tools Workflow
Add Components to the GUIDE Layout Area
Programmatic Workflow
Create Figures for Programmatic GUIs
Add Components to a Programmatic GUI
Concepts
GUIDE Components
Programmatic Components
Menus and ToolbarsMenu items and tools at the top of a window
Examples and How To
Tools Workflow
Create Menus for GUIDE GUIs
Create Toolbars for GUIDE GUIs
Programmatic Workflow
Create Menus for Programmatic GUIs
Create Toolbars for Programmatic GUIs
Predefined Dialog BoxesDialog boxes to report status, gather user input, and interact with operating
system or printers
Component LayoutPosition, size, and alignment of components; text formatting
Examples and How To
Tools Workflow
Set the GUIDE GUI Size
Copy, Paste, and Arrange Components
Locate and Move Components
Resize GUIDE GUI Components
Align GUIDE GUI Components
Set Tab Order in a GUIDE GUI
View the GUIDE GUI Object Hierarchy
Design GUIDE GUIs for Cross-Platform Compatibility
Save a GUIDE GUI
Create a Programmatic GUI Code File from GUIDE GUI Files

Rename GUIDE GUIs and GUI Files


Programmatic Workflow
Layout Programmatic GUIs with Interactive Tools
Set Tab Order in a Programmatic GUI
Design Programmatic GUIs for Cross-Platform Compatibility
Coding GUI BehaviorControl GUI behavior
Start Here
A callback is a function that you write to make components, such as buttons, sliders, or menus, respond
to user input, such as button clicks, slider movements, and menu item selections.
Examples and How To
Code Functionality into Your GUI
Write Callbacks Using the Programmatic Workflow
Write Callbacks Using the GUIDE Workflow
Callbacks for Specific Components
Share Data Among Callbacks
Initialize a Programmatic GUI
Initialize a GUIDE GUI
Interrupt Callback Execution
Sample Programmatic GUIs
Synchronized Data Presentations in a Programmatic GUI
GUI That Accepts and Returns Arguments
Axes, Menus, and Toolbars in Programmatic GUIs
Lists of Items in a Programmatic GUI
Sample GUIDE GUIs
Synchronized Data Presentations in a GUIDE GUI
Modal Dialog Box in a GUIDE GUI
Interactive List Box in a GUIDE GUI
GUI For Managing Persistent Data
GUI That Accepts Parameters and Generates Plots
GUI for Setting Simulink Model Parameters
Plot Workspace Variables in a GUIDE GUI
Animation with Slider Controls in a GUIDE GUI
Automatically Refresh Plot in a GUIDE GUI
Packaging GUIs as AppsPackage and share your apps
Start Here
Apps are interactive applications written to solve common technical computing tasks. Some MATLAB
products install with apps included. You can also create and share your own apps. For more information,
see Apps Overview.
Consider using the functions that follow to automate tasks such as testing and debugging your apps.
Examples and How To
Package Apps
Modify Apps
Share Apps
Concepts
Apps Overview
MATLAB App Installer File mlappinstall
Dependency Analysis

AppsFind, run, and install apps

Start Here
MATLAB apps help you solve common technical computing tasks interactively. Apps typically consist of
a graphical user interface (GUI), underlying code for performing the intended actions, associated data,
and other supporting files.
For information on locating apps you can use, see Find Apps.
How To
Find Apps
View App File List
Run, Uninstall, Reinstall, and Install Apps
Install Apps in a Shared Network Location
Change Apps Installation Folder
Concepts
MATLAB App Installer File mlappinstall

Advanced Software Development


Object-Oriented ProgrammingObject-oriented programming with MATLAB

Start Here
Develop your application using object-oriented techniques with MATLAB. See Begin Using ObjectOriented Programming to get started.
Object-Oriented Design with MATLAB
Advantages of OOD with some basic MATLAB examples
Class Syntax Fundamentals
Quick reference guide to all syntax used to define MATLAB classes and class members, including
example classes
Defining MATLAB Classes
Detailed discussion of how to implement MATLAB classes
Getting Information About Classes and Objects
Class metadata provides information about classes and objects
Object-Oriented Design with MATLABAdvantages of OOD with some basic MATLAB examples
Examples and How To
Developing Classes Typical Workflow
Working with Objects in Functions
Class to Represent Structured Data
Class to Implement Linked Lists
Class for Graphing Functions
Class for Polynomials
Concepts
Why Use Object-Oriented Design
Classes in the MATLAB Language
Handle Objects
Comparing MATLAB with Other OO Languages
Class Diagram Notation
Related Information
Developing Classes Overview (10 min, 48 sec)
Class Syntax FundamentalsQuick reference guide to all syntax used to define MATLAB classes and
class members, including example classes
Examples and How To

Class Components
Classdef Block
Properties
Methods and Functions
Specifying Attributes
Class Files
Events and Listeners
Calling Superclass Methods on Subclass Objects
Representative Class Code
MATLAB Code Analyzer Warnings
Objects In Switch Statements
Using the Editor and Debugger with Classes
Modifying and Reloading Classes
Compatibility with Previous Versions
Defining MATLAB ClassesDetailed discussion of how to implement MATLAB classes
Class Definition and Organization
Class syntax, attributes, and organization
Properties
Property declaration, attributes, and access.
Methods
Method syntax, attributes, and purpose
Handle Classes
Objects that share references with other objects.
Events
Actions that broadcast notices to listeners
Object Arrays
Object array construction and concatenation
Class Hierarchies
Syntax and application of class hierarchies
Enumerations
Fixed set of names representing a single type of value
Control Save and Load
Customize the save and load process
Customize MATLAB Behavior
Implementing concatenation, indexing, and other standard behaviors
Custom Object Display
Customize how MATLAB displays objects in the command window
Class Definition and OrganizationClass syntax, attributes, and organization
Examples and How To
Class Definition
Class Attributes
Expressions in Class Definitions
Organizing Classes in Folders
Class Precedence
Packages Create Namespaces
Importing Classes
Concepts
User-Defined Classes

PropertiesProperty declaration, attributes, and access.


Examples and How To
How to Use Properties
Defining Properties
Property Attributes
Property Access Methods
Properties with Constant Values
Dynamic Properties Adding Properties to an Instance
Concepts
Mutable and Immutable Properties
MethodsMethod syntax, attributes, and purpose
Examples and How To
How to Use Methods
Method Attributes
Ordinary Methods
Class Constructor Methods
Static Methods
Overloading Functions for Your Class
Class Support for Array-Creation Functions
Object Precedence in Expressions Using Operators
Class Methods for Graphics Callbacks
Handle ClassesObjects that share references with other objects.
Start Here
Create the appropriate type of class for your application:
Value classes enable you to create new array classes that have the same semantics as numeric classes.
Handle classes enable you to create objects that more than one function or object can share.
See Modifying Objects for more information.
Examples and How To
The Handle Superclass
Finding Handle Objects and Properties
Implementing a Set/Get Interface for Properties
Controlling the Number of Instances
Concepts
Comparing Handle and Value Classes
Which Kind of Class to Use
Handle Class Destructor
EventsActions that broadcast notices to listeners
Examples and How To
Learning to Use Events and Listeners
Create a Property Set Listener
Event Attributes
Events and Listeners Syntax and Techniques
Listen for Changes to Property Values
Update Graphs Using Events and Listeners
Concepts
Events and Listeners Concepts
Object ArraysObject array construction and concatenation
Examples and How To

Creating Object Arrays


Concatenating Objects of Different Classes
Class HierarchiesSyntax and application of class hierarchies
Examples and How To
Creating Subclasses Syntax and Techniques
Modifying Superclass Methods and Properties
Subclassing Multiple Classes
Supporting Both Handle and Value Subclasses
Subclassing MATLAB Built-In Types
Defining Abstract Classes
Defining Interfaces
A Simple Class Hierarchy
Containing Assets in a Portfolio
Concepts
Hierarchies of Classes Concepts
Controlling Allowed Subclasses
Controlling Access to Class Members
EnumerationsFixed set of names representing a single type of value
Examples and How To
Working with Enumerations
Enumerations Derived from Built-In Types
Mutable (Handle) vs. Immutable (Value) Enumeration Members
Enumerations That Encapsulate Data
Saving and Loading Enumerations
Concepts
Defining Named Values
Control Save and LoadCustomize the save and load process
Examples and How To
Modifying the Save and Load Process
Maintaining Class Compatibility
Passing Arguments to Constructors During Load
Saving and Loading Objects from Class Hierarchies
Saving and Loading Dynamic Properties
Tips for Saving and Loading
Concepts
Understanding the Save and Load Process
Customize MATLAB BehaviorImplementing concatenation, indexing, and other standard behaviors
Examples and How To
Methods That Modify Default Behavior
Redefining Concatenation for Your Class
Converting Objects to Another Class
Indexed Reference and Assignment
Implementing Operators for Your Class
Custom Object DisplayCustomize how MATLAB displays objects in the command window
Examples and How To
Choose a Technique for Display Customization
Customize Property Display
Customize Header, Property List, and Footer

Customize Display of Scalar Objects


Customize Display of Object Arrays
Customize Display for Heterogeneous Arrays
Overload the disp Function
Concepts
Custom Display Interface
How CustomDisplay Works
Class with Default Object Display
Role of size Function in Custom Displays

Getting Information About Classes and ObjectsClass metadata provides information about classes

and objects
Examples and How To
Class Metadata
Inspecting Class and Object Metadata
Finding Objects with Specific Values
Getting Information About Properties
Find Default Values in Property Metadata
Calling External FunctionsIn MATLAB, use functionality from other languages, such as Java,
.NET, and C
Call MEX-File Functions
Call C/C++ or Fortran MEX-file functions from MATLAB
Call C Shared Libraries
Directly call C library functions from MATLAB
Call Java Libraries
Access Java libraries from MATLAB
Call .NET Libraries
Access .NET libraries from MATLAB
Call COM Objects
Access COM components and ActiveX controls from MATLAB
Call Web Services
Communicate with Web services from MATLAB
Call MEX-File FunctionsCall C/C++ or Fortran MEX-file functions from MATLAB
Start Here
A MEX-file is a function, created in MATLAB, that calls a C, C++, or Fortran subroutine. To call a MEX-file,
use the name of the file, without the file extension. The MEX-file contains only one function or
subroutine, and its name is the MEX-file name. The file must be on your MATLAB path.
For information about creating MEX-files, see MEX-File Creation API.
Concepts
Using MEX-Files
MEX-File Placement
What You Need to Run a MEX-File You Receive from Someone Else
Troubleshooting
Version Compatibility
Platform Compatibility
Invalid MEX-File Error
Call C Shared LibrariesDirectly call C library functions from MATLAB
Examples and How To

Shared Library shrlibsample.c


Pass String Arguments
Pass Structures
Work with libstruct Objects
Pass Enumerated Types
Pass Pointers
Pass Arrays
Iterate Through an Array
Create Alias Function Name Using Prototype File
Concepts
Calling Functions in Shared Libraries
Passing Arguments to Shared Library Functions
Working with Structure Arguments
Working with Pointer Arguments
MATLAB Prototype Files
Troubleshooting
Limitations to Shared Library Support
Module Not Found Error
No Matching Signature Error
MATLAB Crashes Calling Function in Shared Library
Call Java LibrariesAccess Java libraries from MATLAB
Start Here
Use one of the following to call methods on Java objects:
% MATLAB syntax
method(object,arg1,...,argn)
/* Java syntax */
object.method(arg1,...,argn)
% Method name exceeds maximum length of MATLAB identifier
javaMethod(method,object,arg1,...,argn)
Examples and How To
Read URL
Find Internet Protocol Address
Create and Use Phone Book
Concepts
Overview of Java Interface
Bringing Java Classes into MATLAB Workspace
Creating and Using Java Objects
Invoking Methods on Java Objects
Working with Java Arrays
Passing Data to Java Methods
Handling Data Returned from Java Methods
Troubleshooting
Java Heap Memory Preferences
Call .NET LibrariesAccess .NET libraries from MATLAB
Getting Started
Examples and concepts to help you quickly get started using .NET in MATLAB.
Data Types
Data conversion, pass data between MATLAB and .NET

Properties
Get and set .NET properties in MATLAB, special features of .NET properties
Methods
Use .NET methods in MATLAB, method signatures, arguments by reference, optional arguments
Events and Delegates
Use .NET event callbacks, create and call .NET delegates
Enumerations
Create and combine .NET enumerations in MATLAB
Generic Classes
Create .NET generic classes, invoke .NET generic methods in MATLAB
Getting StartedExamples and concepts to help you quickly get started using .NET in MATLAB.
Start Here
The Microsoft .NET Framework is a component that provides a large body of precoded solutions to
common program requirements. You can create instances of .NET classes and interact with .NET
applications from MATLAB. See Overview Using .NET from MATLAB.
Examples and How To
Access a Simple .NET Class
Load a Global .NET Assembly
Work with Microsoft Excel Spreadsheets Using .NET
Work with Microsoft Word Documents Using .NET
Build a .NET Application for MATLAB Examples
Simplify .NET Class Names
Nested Classes
Handle .NET Exceptions
Concepts
An Assembly is a Library of .NET Classes
Overview Using .NET from MATLAB
Using a .NET Object
.NET Terminology
Troubleshooting
Troubleshooting Security Policy Settings From Network Drives
Limitations to .NET Support
Data TypesData conversion, pass data between MATLAB and .NET
Examples and How To
Pass Numeric Arguments
Pass System.String Arguments
Pass System.Enum Arguments
Pass System.Nullable Arguments
Pass Cell Arrays of .NET Data
Pass Jagged Arrays
Convert Nested System.Object Arrays
Concepts
Passing Data to .NET Objects
Handling Data Returned from .NET Objects
Using Arrays with .NET Applications
PropertiesGet and set .NET properties in MATLAB, special features of .NET properties
Examples and How To
Set Static .NET Properties

Call .NET Properties That Take an Argument


Concepts
Using .NET Properties
MATLAB Does Not Display Protected Properties
MethodsUse .NET methods in MATLAB, method signatures, arguments by reference, optional
arguments
Examples and How To
Work with .NET Methods Having Multiple Signatures
Call .NET Methods With out Keyword
Call .NET Methods With ref Keyword
Call .NET Methods With params Keyword
Call .NET Methods with Optional Arguments
Call .NET Properties That Take an Argument
Concepts
Calling .NET Methods
Calling .NET Methods with Optional Arguments
Calling .NET Extension Methods
How MATLAB Represents .NET Operators
Limitations to Support of .NET Methods
Events and DelegatesUse .NET event callbacks, create and call .NET delegates
Functions
Examples and How To
Use .NET Events in MATLAB
Call .NET Delegates in MATLAB
Create Delegates from .NET Object Methods
Create Delegate Instances Bound to .NET Methods
Call Delegates With out and ref Type Arguments
Combine and Remove .NET Delegates
Concepts
Learning to Use Events and Listeners
.NET Delegates
Calling .NET Methods Asynchronously
Troubleshooting
Limitations to Support of .NET Events
Limitations to Support of .NET Delegates
EnumerationsCreate and combine .NET enumerations in MATLAB
Functions
Examples and How To
Work with Members of a .NET Enumeration
Refer to a .NET Enumeration Member
Display .NET Enumeration Members as Character Strings
Convert .NET Enumeration Values to Type Double
Iterate Through a .NET Enumeration
Use .NET Enumerations to Test for Conditions
Use Bit Flags with .NET Enumerations
Read Special System Folder Path
Concepts
Overview of .NET Enumerations

Default Methods for an Enumeration


.NET Enumerations in the MATLAB Workspace
Use Bit Flags with .NET Enumerations
Troubleshooting
Limitations to Support of .NET Enumerations
Generic ClassesCreate .NET generic classes, invoke .NET generic methods in MATLAB
Examples and How To
Create .NET Collections
Convert .NET Collections to MATLAB Arrays
Create .NET Arrays of Generic Type
Display .NET Generic Methods Using Reflection
Concepts
.NET Generic Classes
Accessing Items in .NET Collections
Call .NET Generic Methods
Call COM ObjectsAccess COM components and ActiveX controls from MATLAB
Examples and How To
Add Grid ActiveX Control in a Figure
Read Excel Spreadsheet Data
Use Internet Explorer in MATLAB Figure
Explore COM Objects
Use Object Properties
Use Methods
Use Events
Save COM Objects
Use MATLAB Application as Automation Client
Deploy ActiveX Controls Requiring Run-Time Licenses
Use Microsoft Forms 2.0 Controls
Use COM Collections
Use MATLAB Application as DCOM Client
Concepts
MATLAB COM Integration
Getting Started with COM
Creating COM Objects
Handling COM Data in MATLAB Software
Getting Interfaces to COM Object
Supported Client/Server Configurations
MATLAB COM Support Limitations
Call Web ServicesCommunicate with Web services from MATLAB
Examples and How To
Access Web Services That Use WSDL Documents
Access Web Services Using MATLAB SOAP Functions
Concepts
How You Can Use Web Services with MATLAB
Ways of Using Web Services in MATLAB
Considerations When Using Web Services
Where to Get Information About Web Services

Exception HandlingCapture and retrieve data on causes of errors

Examples and How To


Capture Information About Exceptions
Throw an Exception
Respond to an Exception
Concepts
Exception Handling in a MATLAB Application
Unit Testing FrameworkWrite and run tests for MATLAB programs
Start Here
Use the xUnit-style MATLAB Unit Testing Framework to write, run, and analyze tests for your MATLAB
programs. You can define how each test checks values and responds to failures. Use setup and teardown
code to establish the pretest state of the system and, after testing, to restore the system to the original
state. Run tests individually or grouped into a test suite. For more information watch MATLAB Unit
Testing Framework.
Write Unit Tests
Assemble test methods into test-case classes
Run Unit Tests
Run test suites in the testing framework
Analyze Test Results
Use test results to identify failures
Write Unit TestsAssemble test methods into test-case classes
Start Here
The matlab.unittest package is anxUnit-style, unit-testing framework for MATLAB. To test a MATLAB
program, write a test case using qualifications, which are methods for testing values and responding to
failures. The test case contains test functions and test fixtures (setup and teardown code).
Examples and How To
Function-Based Unit Tests
Write Function-Based Unit Tests
Write Simple Test Case Using Functions
Write Test Using Setup and Teardown Functions
Class-Based Unit Tests
Write Simple Test Case Using Classes
Write Setup and Teardown Code Using Classes
Write Tests Using Shared Fixtures
Create Basic Custom Fixture
Create Advanced Custom Fixture
Create Basic Parameterized Test
Create Advanced Parameterized Test
Concepts
Types of Qualifications
Related Information
http://en.wikipedia.org/wiki/XUnit
http://xunitpatterns.com/Four%20Phase%20Test.html
Run Unit TestsRun test suites in the testing framework
Start Here
To run a group of tests in matlab.unittest, create a test suite from the matlab.unittest.TestSuite class.
Test suites can contain:

All tests in a package


All tests in a class
All tests in a folder
A single test method
Arrays of test suites
Examples and How To
Create Simple Test Suites
Run Tests for Various Workflows
Add Plugin to Test Runner
Write Plugins to Extend TestRunner
Create Custom Plugin
Analyze Test ResultsUse test results to identify failures
Examples and How To
Analyze Test Case Results
Analyze Failed Test Results
Concepts
Dynamically Filtered Tests
Performance and MemoryImprove performance, reduce memory requirements
Code Performance
Profiler, improve performance and find potential problems in MATLAB code
Memory Usage
Identify and reduce memory requirements
Code PerformanceProfiler, improve performance and find potential problems in MATLAB code
Functions
Examples and How To
Analyzing Your Program's Performance
Profiling for Improving Performance
Determining Profiler Coverage
Concepts
Techniques for Improving Performance
Vectorization
Memory UsageIdentify and reduce memory requirements
Examples and How To
Strategies for Efficient Use of Memory
Resolving "Out of Memory" Errors
Toolbox Path Caching in MATLAB
Concepts
Memory Allocation
Memory Management Functions
MATLAB Environment ControlInteract programmatically with the MATLAB environment

Custom DocumentationAdd help and documentation for your programs


Examples and How To
Add Help for Your Program
Create Help for Classes
Check Which Programs Have Help
Create Help Summary Files (Contents.m)
Display Custom Documentation

Display Custom Examples

MATLAB API for Other LanguagesInteract with MATLAB and MATLAB data types from other
language applications; write C/C++/Fortran functions to call from MATLAB (MEX-files)
MATLAB Engine API
Call MATLAB from C/C++ and Fortran programs
MATLAB COM Automation Server
Call MATLAB from COM components and applications
MAT-File API
Read and write MATLAB data from C/C++ and Fortran programs
MEX-File Creation API
Build MATLAB functions from C/C++ and Fortran functions
C/C++ Matrix Library API
Write C/C++ programs that work with the MATLAB mxArray data structure
Fortran Matrix Library API
Write Fortran programs that work with the MATLAB mxArray data structure
MATLAB Engine APICall MATLAB from C/C++ and Fortran programs
Examples and How To
Call MATLAB Functions from C and C++ Applications
Call MATLAB Functions from Fortran Applications
Build Windows Engine Application
Build Mac and Linux Engine Application
Attach to Existing MATLAB Sessions
Concepts
Introducing MATLAB Engine
What You Need to Build Engine Applications
Building Engine Applications on Windows Systems
Building Engine Applications on Mac and Linux Systems
Compiling Engine Applications with IDE
GUI-Intensive Applications
Troubleshooting
Can't Start MATLAB Engine
Debugging MATLAB Functions Used in Engine Applications
Related Information
MATLAB COM Automation Server
C/C++ Matrix Library API
Fortran Matrix Library API
MATLAB COM Automation ServerCall MATLAB from COM components and applications
Examples and How To
Call MATLAB Function from Visual Basic .NET Client
Call MATLAB Function from Web Application
Call MATLAB Function from C# Client
View MATLAB Functions from Visual Basic .NET Object Browser
Launch MATLAB as Automation Server in Desktop Mode
Manually Create Automation Server
Concepts
MATLAB COM Automation Server Interface
Creating the MATLAB Server

Connecting to an Existing MATLAB Server


MATLAB Automation Server Functions and Properties
Specifying Shared or Dedicated Server
Using VT_DATE Data Type
Using MATLAB Application as DCOM Server
MAT-File APIRead and write MATLAB data from C/C++ and Fortran programs
Examples and How To
Table of MAT-File Source Code Files
Create MAT-File in C or C++
Read MAT-File in C/C++
Create MAT-File in Fortran
Read MAT-File in Fortran
Work with mxArrays
Copy External Data into MAT-File Format with Standalone Programs
Concepts
Writing Custom Applications to Read and Write MAT-Files
What You Need to Build Custom Applications
Building on UNIX Operating Systems
Building on Windows Operating Systems
Sharing MAT-File Applications
Related Information
C/C++ Matrix Library API
Fortran Matrix Library API
MEX-File Creation APIBuild MATLAB functions from C/C++ and Fortran functions
C/C++ Source Files
Write C/C++ functions using MATLAB API libraries
MEX Library
Use this library to perform operations in the MATLAB environment from C/C++ and Fortran MEX-files
Executable C/C++ MEX-Files
Build C/C++ subroutines into MATLAB functions
Fortran Source Files
Write Fortran subroutines using MATLAB API libraries
Executable Fortran MEX-Files
Build Fortran subroutines into MATLAB functions
Call MEX-File Functions
Call MEX-file functions from MATLAB
Share MEX-Files
Share MEX-files with other MATLAB users
Troubleshoot MEX-Files
Common errors creating and using MEX-files
C/C++ Source FilesWrite C/C++ functions using MATLAB API libraries
Start Here
A MEX-file lets you call a C function from MATLAB. To create a C/C++ MEX-file, you need:
The ability to write C or C++ source code. You can create these files with the MATLAB Editor.
A compiler supported by MATLAB. For an up-to-date list of supported compilers, see the Supported and
Compatible Compilers website.
The C/C++ Matrix Library API and the C MEX Library functions.
The mex build script. For more information, see Executable C/C++ MEX-Files.

For information about writing Fortran MEX-files, see Fortran Source Files.
For information about using the loadlibrary and calllib commands to call functions in shared libraries,
see Call C Shared Libraries.
MEX-files are not appropriate for all applications. MATLAB is a high-productivity environment whose
specialty is eliminating time-consuming, low-level programming in compiled languages like C, C++, or
Fortran. In general, do your programming in MATLAB. Do not use MEX-files unless your application
requires it.
Examples and How To
Create C Source MEX-File
Table of MEX-File Source Code Files
Fill mxArray
Pass Structures and Cell Arrays
Create 2-D Cell Array
Handle 8-, 16-, and 32-Bit Data
Use C++ Features in MEX-Files
Call LAPACK and BLAS Functions
Use Help Files with MEX-Files
User Messages
Error Handling
Testing for Most-Derived Class
Upgrade MEX-Files to Use 64-Bit API
Concepts
Introducing MEX-Files
Components of MEX-File
MATLAB API Libraries
MATLAB Data
Data Flow in MEX-Files
Memory Management
Creating C++ MEX-Files
Handling Large mxArrays
Handling Large File I/O
Related Information
C/C++ Matrix Library API
MEX Library
MEX LibraryUse this library to perform operations in the MATLAB environment from C/C++ and Fortran
MEX-files
Executable C/C++ MEX-FilesBuild C/C++ subroutines into MATLAB functions
Start Here
To help you configure your system using a sample MEX-file, see Build MEX-File.
For information about writing a MEX-file, see Create C Source MEX-File.
Examples and How To
Build MEX-File
Concepts
What You Need to Build MEX-Files
Changing Default Compiler
Troubleshooting
Debugging on Microsoft Windows Platforms
Debugging on Mac Platforms

Debugging on Linux Platforms


Understanding MEX-File Problems
Fortran Source FilesWrite Fortran subroutines using MATLAB API libraries
Start Here
A MEX-file lets you call a Fortran subroutine from MATLAB. To create a MEX-file, you need:
The ability to write Fortran source code. You can create these files with the MATLAB Editor.
A compiler supported by MATLAB. For an up-to-date list of supported compilers, see the Supported and
Compatible Compilers website.
The Fortran Matrix Library API and the Fortran MEX Libraryfunctions.
The mex build script. For more information, see Executable Fortran MEX-Files.
For information about writing C/C++ MEX-files, see C/C++ Source Files.
For information about using the loadlibrary and calllib commands to call functions in shared libraries,
see Call C Shared Libraries.
MEX-files are not appropriate for all applications. MATLAB is a high-productivity environment whose
specialty is eliminating time-consuming, low-level programming in compiled languages like C, C++, or
Fortran. In general, do your programming in MATLAB. Do not use MEX-files unless your application
requires it.
Examples and How To
Create Fortran Source MEX-File
Table of MEX-File Source Code Files
User Messages
Error Handling
Concepts
Components of Fortran MEX-File
MATLAB Fortran API Libraries
Data Flow in Fortran MEX-Files
Memory Management
Handling Large mxArrays
Related Information
Fortran Matrix Library API
MEX Library
Executable Fortran MEX-FilesBuild Fortran subroutines into MATLAB functions
Start Here
To help you configure your system using a sample MEX-file, see Build MEX-File.
For information about writing a MEX-file, see Create C Source MEX-File.
Examples and How To
Build Fortran MEX-File
Concepts
What You Need to Build MEX-Files
Changing Default Compiler
Using MEX Script Options to Custom Build
Troubleshooting
Debug Fortran Source MEX-Files
Compiler Errors in Fortran MEX-Files
Understanding MEX-File Problems
Executable Fortran MEX-FilesBuild Fortran subroutines into MATLAB functions
Start Here
To help you configure your system using a sample MEX-file, see Build MEX-File.

For information about writing a MEX-file, see Create C Source MEX-File.


Examples and How To
Build Fortran MEX-File
Concepts
What You Need to Build MEX-Files
Changing Default Compiler
Using MEX Script Options to Custom Build
Troubleshooting
Debug Fortran Source MEX-Files
Compiler Errors in Fortran MEX-Files
Understanding MEX-File Problems
Call MEX-File FunctionsCall MEX-file functions from MATLAB
Start Here
A MEX-file is a function, created in MATLAB, that calls a C, C++, or Fortran subroutine. To call a MEX-file,
use the name of the file, without the file extension. The MEX-file contains only one function or
subroutine, and its name is the MEX-file name. The file must be on your MATLAB path.
Call MEX-File Functions
Call MEX-file functions from MATLAB
Start Here
A MEX-file is a function, created in MATLAB, that calls a C, C++, or Fortran subroutine. To call a MEX-file,
use the name of the file, without the file extension. The MEX-file contains only one function or
subroutine, and its name is the MEX-file name. The file must be on your MATLAB path.
Examples and How To
Build MEX-File
Concepts
Using MEX-Files
MEX-File Placement
What You Need to Run a MEX-File You Receive from Someone Else
Troubleshooting
Version Compatibility
Platform Compatibility
Invalid MEX-File Error
Share MEX-FilesShare MEX-files with other MATLAB users
Examples and How To
Document Build Information in the MEX-File
Concepts
MEX-File Dependent Libraries
Troubleshooting
Platform Compatibility
Invalid MEX-File Error
C/C++ Matrix Library APIWrite C/C++ programs that work with the MATLAB mxArray data structure
Start Here
For examples using these library functions and information about building programs with this library,
see:
Table of MEX-File Source Code Files
Build MEX-File
What You Need to Build Engine Applications
What You Need to Build Custom Applications

For the Fortran library, see Fortran Matrix Library API.


For the MEX Library, see MEX Library.
For the Engine Library, see MATLAB Engine API.
For the MAT-File Library, see MAT-File API.
Data Types
Data types and constants
Create or Delete Array
Create array of specified type, allocate and free memory
Validate Data
Determine type or characteristic of array data
Access Data
Read or write data to array
Convert Data Types
Convert strings, and structure array to object array
Troubleshoot MEX-FilesCommon errors creating and using MEX-files
Examples and How To
Debugging on Microsoft Windows Platforms
Debugging on Mac Platforms
Debugging on Linux Platforms
Debug Fortran Source MEX-Files
Concepts
Invalid MEX-File Error
Understanding MEX-File Problems
Platform Compatibility
Compiler- and Platform-Specific Issues
Memory Management Issues
Running MEX-Files with .DLL File Extensions on Windows 32-bit Platforms
Data TypesData types and constants
Create or Delete ArrayCreate array of specified type, allocate and free memory
Examples and How To
Pass Strings
Validate DataDetermine type or characteristic of array data
Examples and How To
Pass Scalar Values
Access DataRead or write data to array
Convert Data TypesConvert strings, and structure array to object array
Fortran Matrix Library APIWrite Fortran programs that work with the MATLAB mxArray data
structure
Start Here
For examples using these library functions and information about building programs with this library,
see:
Table of MEX-File Source Code Files
Build Fortran MEX-File
What You Need to Build Engine Applications
What You Need to Build Custom Applications
For the C/C++ library, see C/C++ Matrix Library API.
For the MEX Library, see MEX Library.
Data Types

Data types and constants


Create or Delete Array
Create array of specified type, allocate and free memory
Validate Data
Determine type or characteristic of array data
Access Data
Read or write data to array
Convert Arrays
Convert array to pass by reference, not by value
Data TypesData types and constants
Create or Delete ArrayCreate array of specified type, allocate and free memory
Validate DataDetermine type or characteristic of array data
Access DataRead or write data to array
Convert ArraysConvert array to pass by reference, not by value
Source Control IntegrationInterface MATLAB with source control system
Examples and How To
Set Up Source Control (Microsoft Windows)
Check Files In and Out (Microsoft Windows)
Additional Source Control Actions (Microsoft Windows)
Access Source Control from Editors (Microsoft Windows)
Troubleshoot Source Control Problems (Microsoft Windows)
Specify Source Control System (UNIX Platforms)
Check In Files (UNIX Platforms)
Check Out Files (UNIX Platforms)
Undo the Checkout (UNIX Platforms)
Concepts
Source Control Interface on Microsoft Windows
Source Control Interface on UNIX Platforms

Desktop Environment
Startup and Shutdown

Startup command line flags, startup and shutdown files


How To
Start MATLAB on Windows Platforms
Associate Files with MATLAB on Windows Platforms
Start MATLAB on Linux Platforms
Start MATLAB on Macintosh Platforms
Exit MATLAB
Concepts
Startup Options
MATLAB Startup Folder
Changing the Startup Folder
Startup Folder on Windows Platforms
Startup Folder on Linux Platforms
Startup Folder on Macintosh Platforms
Troubleshooting
Recovering Data After an Abnormal Termination
Error Log Reporting

When MATLAB Terminates Unexpectedly


java.opts Files
Cannot Associate .m Files with MATLAB on Windows
Basic SettingsDesktop appearance, fonts, colors, keyboard shortcuts
How To
Change Fonts
Change Color Settings
Access Frequently Used Features
Define Keyboard Shortcuts
Optimize Desktop Layout for Limited Screen Space
Set Print Options
Concepts
Preferences
AppsFind, run, and install apps
Start Here
MATLAB apps help you solve common technical computing tasks interactively. Apps typically consist of
a graphical user interface (GUI), underlying code for performing the intended actions, associated data,
and other supporting files.
For information on locating apps you can use, see Find Apps.
How To
Find Apps
View App File List
Run, Uninstall, Reinstall, and Install Apps
Install Apps in a Shared Network Location
Change Apps Installation Folder
Concepts
MATLAB App Installer File mlappinstall
Platform and LicenseInformation about current computer, license, product version
How To
License Management and Software Updates
Information About your Installation
Concepts
Macintosh Platform Conventions
InternationalizationLocale settings and messages
How To
Setting Locale on Windows Platforms
Setting Locale on Linux Platforms
Setting Locale on Mac Platforms
Concepts
How the MATLAB Process Uses Locale Settings
Troubleshooting
Asian Characters Incorrectly Displayed on Linux Systems
Characters Incorrectly Displayed on Windows Systems
datenum Might Not Return Correct Value
Numbers Display Period for Decimal Point
File or Folder Names Incorrectly Displayed
Non-ASCII Characters Incorrectly Displayed on Different Platforms

Help and SupportProduct help, technical support


How To
Bookmark and Share Page Locations
Contact Technical Support
Concepts
Ways to Get Function Help
MATLAB Code Examples
Search Syntax and Tips
Help Preferences
Japanese Documentation
Korean and Chinese Documentation

Symbolic Math Toolbox


Perform symbolic math computations
Symbolic Computations in MATLAB
Symbolic variables, expressions, functions, conversions between symbolic and numeric
Mathematics
Equation solving, formula simplification, calculus, linear algebra, and more
Graphics
Two- and three-dimensional plots, data exploration and visualization techniques
Code Generation
Use symbolic results in MATLAB, Simulink, Simscape, C, Fortran, and LaTeX
MuPAD
Perform mathematics using symbolic computation and variable-precision arithmetic in MuPAD
MATLAB and MuPAD Integration
Access MuPAD functionality from MATLAB

Getting Started with Symbolic Math Toolbox


Symbolic Math Toolbox Product Description

System Requirements
Acknowledgments
Tutorials
Access Symbolic Math Toolbox Functionality
Symbolic Objects
Create Symbolic Variables and Expressions
Perform Symbolic Computations
Assumptions on Symbolic Objects
Symbolic Computations in MATLAB
Symbolic variables, expressions, functions, conversions between symbolic and numeric
Symbolic Variables, Expressions, and Functions
Operators and Elementary Operations
Conversion Between Symbolic and Numeric

Mathematics

Equation solving, formula simplification, calculus, linear algebra, and more


Equation Solving
Formula Manipulation and Simplification
Calculus
Linear Algebra
Assumptions
Polynomials
Mathematical Functions
Numbers and Precision
Number Theory

Graphics

Two- and three-dimensional plots, data exploration and visualization techniques


Function Plots
Exploration
Editing and Enhancing
Export

Code Generation
Use symbolic results in MATLAB, Simulink, Simscape, C, Fortran, and LaTeX

MuPAD

Perform mathematics using symbolic computation and variable-precision arithmetic in MuPAD


Getting Started with MuPAD
MuPAD Language Fundamentals
Mathematics
Graphics
Programming Basics
Data and File Management
Advanced Software Development
Code Generation
Notebook Interface

MATLAB and MuPAD Integration


Access MuPAD functionality from MATLAB
MuPAD Function Calls
MuPAD Files and Interfaces
Variables and Expressions Exchange
MuPAD Engine Commands

Symbolic Computations in MATLAB


Symbolic Variables, Expressions, and Functions Create symbolic variables, expressions, and
functions
Examples and How To
Create Symbolic Variables and Expressions
Create Symbolic Functions
Find Symbolic Variables in Expressions, Functions, Matrices
Concepts
Symbolic Objects
Operators and Elementary OperationsArithmetic, relational, and logical operations on
symbolic objects
Arithmetic Operations
Addition, subtraction, multiplication, left and right division, power
Relational Operations
Equality, inequality, and other relational operations
Logical Operations
Logical and, or, xor, not, and other operations
Arithmetic OperationsAddition, subtraction, multiplication, left and right division, power
Relational OperationsEquality, inequality, and other relational operations
Logical OperationsLogical and, or, xor, not, and other operations
Conversion Between Symbolic and NumericConvert symbolic data to numerics or strings,
convert numerics to symbolic objects

Mathematics
Equation SolvingSolve algebraic and differential equations

Algebraic Equations and Systems


Solve algebraic equations and systems of such equations analytically or numerically
Ordinary Differential Equations and Systems
Solve ordinary differential equations and systems of such equations
Algebraic Equations and SystemsSolve algebraic equations and systems of such equations analytically
or numerically
Examples and How To
Solve an Algebraic Equation
Solve a System of Algebraic Equations
Ordinary Differential Equations and SystemsSolve ordinary differential equations and systems of
such equations
Examples and How To
Solve a Single Differential Equation
Solve a System of Differential Equations
Formula Manipulation and Simplification Simplify or modify expressions, substitute parts of
expressions
Simplification
Simplify a long expression to a shorter form
Formula Rearrangement and Rewriting
Transform expressions to a particular form or rewrite them in specific terms
Substitution
Replace parts of expressions with the specified symbolic or numeric values
SimplificationSimplify a long expression to a shorter form
Examples and How To
Simplifications
Formula Rearrangement and RewritingTransform expressions to a particular form or rewrite them in
specific terms
Examples and How To
Simplifications
SubstitutionReplace parts of expressions with the specified symbolic or numeric values
Examples and How To
Substitute with subexpr
Substitute with subs
Combine subs and double for Numeric Evaluations
CalculusSymbolic differentiation, integration, series operations, limits, and transforms
Differentiation
Find derivatives of symbolic expressions or functions
Integration
Compute definite and indefinite integrals analytically
Vector Analysis
Differentiation and integration of vector fields
Series
Series expansions, sums and products of series
Limits
Right, left, and bidirectional limits of symbolic expressions and functions
Transforms
Fourier, Laplace, and Z-transforms, and corresponding inverse transforms

DifferentiationFind derivatives of symbolic expressions or functions

Examples and How To


Differentiation
Find Asymptotes, Critical and Inflection Points
IntegrationCompute definite and indefinite integrals analytically
Examples and How To
Integration
Vector AnalysisDifferentiation and integration of vector fields
SeriesSeries expansions, sums and products of series
Examples and How To
Symbolic Summation
Taylor Series
LimitsRight, left, and bidirectional limits of symbolic expressions and functions
Examples and How To
Limits
TransformsFourier, Laplace, and Z-transforms, and corresponding inverse transforms
Examples and How To
Compute Fourier and Inverse Fourier Transforms
Compute Laplace and Inverse Laplace Transforms
Compute Z-Transforms and Inverse Z-Transforms
Linear AlgebraLinear algebra operations on symbolic vectors and matrices
Matrix Operations and Transformations
Operations on rows and columns, matrix diagonal, inverse, matrix exponential
Matrix Analysis
Norm, determinant, condition number, curl, divergence, gradient, characteristic polynomial, and more
Vector Spaces and Subspaces
Matrix dimensions, rank, null space, reduced row echelon form
Eigenvalues and Eigenvectors
Eigenvalues, eigenvectors, Jordan normal form
Matrix Decomposition
Cholesky, LU, and QR factorizations and singular value decomposition
Linear Equations
Linear systems of equations in matrix form
Matrix Operations and TransformationsOperations on rows and columns, matrix diagonal, inverse,
matrix exponential
Examples and How To
Basic Algebraic Operations
Linear Algebraic Operations
Matrix AnalysisNorm, determinant, condition number, curl, divergence, gradient, characteristic
polynomial, and more
Examples and How To
Basic Algebraic Operations
Linear Algebraic Operations
Vector Spaces and SubspacesMatrix dimensions, rank, null space, reduced row echelon form
Eigenvalues and EigenvectorsEigenvalues, eigenvectors, Jordan normal form
Examples and How To
Eigenvalues

Jordan Canonical Form


Eigenvalue Trajectories

Matrix DecompositionCholesky, LU, and QR factorizations and singular value decomposition


Examples and How To
Singular Value Decomposition
Linear EquationsLinear systems of equations in matrix form
Examples and How To
Linear Algebraic Operations
AssumptionsRestrict possible values of a symbolic object
Examples and How To
Set Assumptions
Check Existing Assumptions
Delete Symbolic Objects and Their Assumptions
Clear Assumptions and Reset the Symbolic Engine
Concepts
Default Assumption
PolynomialsCharacteristic and minimal polynomials, coefficients of polynomials

Mathematical FunctionsLogarithms and special functions

Constants
Mathematical constants
Logarithms
Logarithms to commonly used bases
Trigonometric Functions
Sine, cosine, and related functions
Hyperbolic Functions
Hyperbolic sine, cosine, and related functions
Complex Numbers
Real and imaginary components, polar angle
Special Functions
Collection of special mathematical functions
ConstantsMathematical constants
LogarithmsLogarithms to commonly used bases
Examples and How To
Special Functions of Applied Mathematics
Trigonometric FunctionsSine, cosine, and related functions
Hyperbolic FunctionsHyperbolic sine, cosine, and related functions
Complex NumbersReal and imaginary components, polar angle
Special FunctionsCollection of special mathematical functions
Dirac and Heaviside Functions
Dirac, Heaviside, and step functions
Gamma Functions
Gamma and beta functions, binomial coefficients
Zeta Function and Polylogarithms
Zeta function, dilogarithm and polylogarithm functions
Airy and Bessel Functions
Airy and Bessel functions of the first and second kind

Exponential and Trigonometric Integrals


Trigonometric integral functions, hyperbolic integral functions, Dawson integral
Error Functions
Direct and inverse error functions
Hypergeometric and Whittaker Functions
Hypergeometric, Whittaker M and Whittaker W functions
Elliptic Integrals
Elliptic integrals of the first, second, and third kinds
Lambert W and Wright Functions
Lambert W function (Omega function) and Wright function (omega function)
Dirac and Heaviside FunctionsDirac, Heaviside, and step functions
Examples and How To
Special Functions of Applied Mathematics
Gamma FunctionsGamma and beta functions, binomial coefficients
Examples and How To
Special Functions of Applied Mathematics
Zeta Function and PolylogarithmsZeta function, dilogarithm and polylogarithm functions
Examples and How To
Special Functions of Applied Mathematics
Airy and Bessel FunctionsAiry and Bessel functions of the first and second kind
Examples and How To
Special Functions of Applied Mathematics
Exponential and Trigonometric IntegralsTrigonometric integral functions, hyperbolic integral
functions, Dawson integral
Examples and How To
Special Functions of Applied Mathematics
Error FunctionsDirect and inverse error functions
Examples and How To
Special Functions of Applied Mathematics
Hypergeometric and Whittaker FunctionsHypergeometric, Whittaker M and Whittaker W functions
Examples and How To
Special Functions of Applied Mathematics
Elliptic IntegralsElliptic integrals of the first, second, and third kinds
Lambert W and Wright FunctionsLambert W function (Omega function) and Wright function (omega
function)
Examples and How To
Special Functions of Applied Mathematics
Numbers and PrecisionVariable-precision arithmetic and elementary number-theoretic
operations
Precision Control
Control over accuracy of numeric computations
Operations on Numbers
Quotient and remainder, rounding numbers, real and imaginary components of complex numbers
Precision ControlControl over accuracy of numeric computations
Examples and How To
Choose the Arithmetic
Control Accuracy of Variable-Precision Computations

Recognize and Avoid Round-Off Errors


Improve Performance of Numeric Computations
Estimate Precision of Numeric to Symbolic Conversions
Operations on NumbersQuotient and remainder, rounding numbers, real and imaginary components
of complex numbers
Number TheoryModular arithmetic operations and sequences of numbers

Graphics
Function PlotsPlot symbolic expressions, equations, and functions in 2-D and 3-D

Examples and How To


Create Plots
ExplorationVisualize and explore features of a symbolic expression, equation, or function
Examples and How To
Explore Function Plots
Editing and EnhancingEnhance visual display of a plot
Examples and How To
Edit Graphs
ExportExport or print graphics to standard file formats
Examples and How To
Save Graphs

Code Generation
Use symbolic results in MATLAB, Simulink, Simscape, C, Fortran,
and LaTeX
Examples and How To
Generate C or Fortran Code
Generate MATLAB Functions
Generate MATLAB Function Blocks
Generate Simscape Equations

MuPAD
Getting Started with MuPADExamples and concepts to help you quickly get started using
MuPAD
Examples and How To
Create MuPAD Notebooks
Save MuPAD Notebooks
Desktop Overview
Evaluate Mathematical Expressions and Commands
Quickly Access Standard MuPAD Functions
Access Help for Particular Command
Perform Computations
Use Graphics
Format and Export Documents and Graphics
Use Data Structures
Use the MuPAD Libraries

Programming Basics
Debug MuPAD Code Using the Debugger
Edit MuPAD Code in MATLAB Editor
Glossary

MuPAD Language FundamentalsSyntax, operators, data types, libraries, structures for data

storage
Entering Commands
Build and run MuPAD statements
Operators and Elementary Operations
Arithmetic, relational, logical, and set operations; precedence of operators
Special Values
FAIL, NIL, undefined, Boolean constants, special sets of numbers
Data Types
Structures for storing data, data type identification, and conversion to other data types
Symbols and Special Characters
Greek letters, subscript and superscript, special characters
Entering CommandsBuild and run MuPAD statements
Operators and Elementary OperationsArithmetic, relational, logical, and set operations; precedence
of operators
Arithmetic Operations
Addition, subtraction, multiplication, left and right division, power
Relational Operations
Equality, inequality, and other relational operations
Logical Operations
Logical and, or, xor, not, and other operations
Set Operations
Unions, intersections, set memberships
Expression Trees and Precedence
Precedence of operators in an expression, techniques to substitute parts of an expression
Arithmetic OperationsAddition, subtraction, multiplication, left and right division, power
Relational OperationsEquality, inequality, and other relational operations
Logical OperationsLogical and, or, xor, not, and other operations
Set OperationsUnions, intersections, set memberships
Expression Trees and PrecedencePrecedence of operators in an expression, techniques to substitute
parts of an expression
Examples and How To
Mathematical Expressions
Visualize Expression Trees
Modify Subexpressions
Concepts
The misc Library

Special Values

FAIL, NIL, undefined, Boolean constants, special sets of numbers


Data TypesStructures for storing data, data type identification, and conversion to other data types
Data Structures
Structures for storing data, operations on such structures, techniques for data collection
Identification
Determine data type of a MuPAD object
Conversion
Convert between data types
Data StructuresStructures for storing data, operations on such structures, techniques for data
collection
Common Operations
Create and modify data structures, access and count their elements
Operations on Lists
Create, analyze, modify, and convert lists
Operations on Strings
Create, analyze, and modify strings
Common OperationsCreate and modify data structures, access and count their elements
Examples and How To
Sequences
Lists
Sets
Tables
Arrays
Vectors and Matrices
Choose Appropriate Data Structures
Data Collection
Operations on ListsCreate, analyze, modify, and convert lists
Examples and How To
Lists
Operations on StringsCreate, analyze, and modify strings

IdentificationDetermine data type of a MuPAD object


Indeterminates, Expressions, Equations, Constants
Data types representing variables, expressions, constants, equations, relations
Numbers
Data types representing various kinds of numbers
Data Structures
Data types representing lists, sequences, sets, tables, polynomials
Type Checking
Functions for checking data types of MuPAD objects
Indeterminates, Expressions, Equations, ConstantsData types representing variables, expressions,
constants, equations, relations

Examples and How To


Choose Appropriate Data Structures
Concepts
Data Type Definition
Type Checking and Mathematical Properties
NumbersData types representing various kinds of numbers
Examples and How To
Choose Appropriate Data Structures
Concepts
Data Type Definition
Type Checking and Mathematical Properties
Data StructuresData types representing lists, sequences, sets, tables, polynomials
Examples and How To
Choose Appropriate Data Structures
Concepts
Data Type Definition
Type Checking and Mathematical Properties
Type CheckingFunctions for checking data types of MuPAD objects
Examples and How To
Choose Appropriate Data Structures
Concepts
Data Type Definition
Type Checking and Mathematical Properties
ConversionConvert between data types
MuPAD Functions
Examples and How To
Convert Data Types
Symbols and Special CharactersGreek letters, subscript and superscript, special characters
Examples and How To
Greek Letters in Text Regions
Special Characters in Outputs
Non-Greek Characters in Text Regions
Use Different Output Modes
Concepts
Typeset Symbols

MathematicsEquation solving, formula simplification, calculus, linear algebra, statistics, number

theory, and more


Equation Solving
Solve algebraic and differential equations analytically or numerically
Formula Manipulation and Simplification
Simplify or modify expressions, substitute parts of expressions, evaluate expressions or subexpressions
Calculus

Differentiation, integration, series operations, limits, and transforms


Linear Algebra
Matrix analysis, linear equations, eigenvalues, singular values, matrix exponential, factorization
Polynomial Algebra
Polynomials, their properties, and operations on them, orthogonal polynomials, Groebner bases
Mathematical Constants and Functions
Mathematical constants, complex numbers, logarithms, exponential, trigonometric, hyperbolic, and
special functions
Numbers and Precision
Variable-precision arithmetic, elementary number-theoretic operations
Statistics
Algorithms and tools for organizing, analyzing, and modeling statistical data
Discrete Mathematics
Elementary number-theoretic operations, linear optimizations, graph theory, and more
Equation SolvingSolve algebraic and differential equations analytically or numerically
Symbolic Solvers
Solve algebraic equations and systems analytically, simplify results, test solutions
Numeric Solvers
Approximate solutions of equations and systems numerically
Ordinary Differential Equations
Solve ODEs analytically, test solutions
Properties and Assumptions
Restrict possible values of variables or expressions
Utilities for the Solver
Utilities typically used by the symbolic solver which also can be used directly
Symbolic SolversSolve algebraic equations and systems analytically, simplify results, test solutions
Examples and How To
Choose a Solver
Solve Algebraic Equations and Inequalities
Solve Algebraic Systems
Test Results
Concepts
If Results Look Too Complicated
If Results Differ from Expected
Numeric SolversApproximate solutions of equations and systems numerically
Examples and How To
Choose a Solver
Solve Equations Numerically
Concepts
Numeric Algorithms Library

Ordinary Differential EquationsSolve ODEs analytically, test solutions

Examples and How To


Choose a Solver
Solve Ordinary Differential Equations and Systems
Test Results
Concepts
If Results Look Too Complicated
If Results Differ from Expected
Properties and AssumptionsRestrict possible values of variables or expressions
Examples and How To
Use Permanent Assumptions
Use Temporary Assumptions
Concepts
Properties
When to Use Assumptions
Utilities for the SolverUtilities typically used by the symbolic solver which also can be used directly

Formula Manipulation and Simplification Simplify or modify expressions, substitute parts of

expressions, evaluate expressions or subexpressions


Simplification
Simplify a long expression to a shorter form
Formula Rearrangement and Rewriting
Transform expressions to a particular form or rewrite them in specific terms
Substitution
Replace parts of expressions with the specified symbolic or numeric values
Evaluation
Control evaluation and level of evaluation, prevent infinite recursions
Properties and Assumptions
Restrict possible values of variables or expressions
SimplificationSimplify a long expression to a shorter form
Examples and How To
Use General Simplification Functions
Choose Simplification Functions
Convert Expressions Involving Special Functions
Concepts
If You Want to Simplify Results Further
Formula Rearrangement and RewritingTransform expressions to a particular form or rewrite them
in specific terms
Examples and How To
Choose Simplification Functions
Convert Expressions Involving Special Functions
Concepts
If You Want to Simplify Results Further

SubstitutionReplace parts of expressions with the specified symbolic or numeric values


Examples and How To
Modify Subexpressions
EvaluationControl evaluation and level of evaluation, prevent infinite recursions
Examples and How To
Enforce Evaluation
Prevent Evaluation
Evaluate at a Point
Concepts
Evaluations in Symbolic Computations
Level of Evaluation
Actual and Displayed Results of Evaluations
Properties and AssumptionsRestrict possible values of variables or expressions
Examples and How To
Use Permanent Assumptions
Use Temporary Assumptions
Concepts
Properties
When to Use Assumptions
CalculusDifferentiation, integration, series operations, limits, and transforms
Differentiation
Find derivatives of expressions or functions
Integration
Definite and indefinite integrals, numeric approximation of integrals, integration methods
Vector Analysis
Differentiation and integration of vector fields
Series
Series expansions, sums and products of series
Limits
Right, left, and bidirectional limits of symbolic expressions and functions
Transforms
Fourier, Laplace, and Z-transforms, corresponding inverse transforms, custom transform patterns
Properties and Assumptions
Restrict possible values of variables or expressions
DifferentiationFind derivatives of expressions or functions
Examples and How To
Choose Differentiation Function
Differentiate Expressions
Differentiate Functions

IntegrationDefinite and indefinite integrals, numeric approximation of integrals, integration methods


Examples and How To

Compute Indefinite Integrals


Compute Definite Integrals
Compute Multiple Integrals
Apply Standard Integration Methods Directly
Get Simpler Results
If an Integral Is Undefined
If MuPAD Cannot Compute an Integral
Concepts
Integration Utilities
Numeric Algorithms Library
Vector AnalysisDifferentiation and integration of vector fields

SeriesSeries expansions, sums and products of series


Expansion
Taylor series, theta series, Pade series, and generalized series
Summation
Definite and indefinite summation, numeric approximation of sums of series
Products
Definite and indefinite products, numeric approximation of products of series
ExpansionTaylor series, theta series, Pade series, and generalized series
Examples and How To
Compute Taylor Series for Univariate Expressions
Compute Taylor Series for Multivariate Expressions
Control Number of Terms in Series Expansions
Compute Generalized Series
Concepts
O-term (The Landau Symbol)
SummationDefinite and indefinite summation, numeric approximation of sums of series
Examples and How To
Compute Symbolic Sums
Approximate Sums Numerically
ProductsDefinite and indefinite products, numeric approximation of products of series
LimitsRight, left, and bidirectional limits of symbolic expressions and functions
Examples and How To
Compute Bidirectional Limits
Compute Right and Left Limits
Concepts
If Limits Do Not Exist
TransformsFourier, Laplace, and Z-transforms, corresponding inverse transforms, custom transform
patterns
Fourier and Laplace Transforms
Fourier and Laplace transforms and their inverses

Z-Transform
Z-transform and its inverse
Fast Fourier Transform
Fast Fourier transform and its inverse
New Patterns for Transforms
Introduce new transform patterns, edit existing transform patterns
Fourier and Laplace TransformsFourier and Laplace transforms and their inverses
Examples and How To
Integral Transforms
Z-TransformZ-transform and its inverse
Examples and How To
Z-Transforms
Fast Fourier Transform
Fast Fourier transform and its inverse
Examples and How To
Discrete Fourier Transforms
Concepts
Numeric Algorithms Library
New Patterns for TransformsIntroduce new transform patterns, edit existing transform patterns
Examples and How To
Use Custom Patterns for Transforms
Properties and AssumptionsRestrict possible values of variables or expressions
Examples and How To
Use Permanent Assumptions
Use Temporary Assumptions
Concepts
Properties
When to Use Assumptions
Linear AlgebraMatrix analysis, linear equations, eigenvalues, singular values, matrix exponential,
factorization
Matrix and Vector Construction
Matrices, arrays, vectors, and special matrices
Matrix Operations and Transformations
Operations on rows and columns, scalar and vector products, transpose, and inverse
Matrix Analysis
Norm, determinant, condition, curl, divergence, gradient, and more
Vector Spaces and Subspaces
Matrix dimensions, rank, null space, reduced row echelon form
Eigenvalues and Eigenvectors
Eigenvalues, eigenvectors, Jordan normal form
Matrix Decomposition

Cholesky, LU, and QR factorizations, singular value decomposition, Jordan, Frobenius, Hermite, and
Smith forms of matrices
Linear Equations
Linear systems of equations in matrix form
Properties and Assumptions
Restrict possible values of variables or expressions
Matrix and Vector ConstructionMatrices, arrays, vectors, and special matrices
Examples and How To
Create Matrices
Create Vectors
Create Special Matrices
Access and Modify Matrix Elements
Create Matrices over Particular Rings
Concepts
Use Sparse and Dense Matrices
Linear Algebra Library
Matrix Operations and TransformationsOperations on rows and columns, scalar and vector
products, transpose, and inverse
Examples and How To
Compute with Matrices
Invert Matrices
Transpose Matrices
Swap and Delete Rows and Columns
Compute Matrix Exponentials
Concepts
Linear Algebra Library
Numeric Algorithms Library

Matrix AnalysisNorm, determinant, condition, curl, divergence, gradient, and more


Examples and How To
Compute with Matrices
Compute Determinants and Traces of Square Matrices
Compute Determinant Numerically
Concepts
Linear Algebra Library
Numeric Algorithms Library
Vector Spaces and SubspacesMatrix dimensions, rank, null space, reduced row echelon form
Examples and How To
Compute Dimensions of a Matrix
Compute Reduced Row Echelon Form
Compute Rank of a Matrix
Compute Bases for Null Spaces of Matrices

Concepts
Linear Algebra Library
Numeric Algorithms Library

Eigenvalues and EigenvectorsEigenvalues, eigenvectors, Jordan normal form


Examples and How To
Find Eigenvalues and Eigenvectors
Find Jordan Canonical Form of a Matrix
Compute Eigenvalues and Eigenvectors Numerically
Concepts
Linear Algebra Library
Numeric Algorithms Library
Matrix DecompositionCholesky, LU, and QR factorizations, singular value decomposition, Jordan,
Frobenius, Hermite, and Smith forms of matrices
Examples and How To
Compute Cholesky Factorization
Compute LU Factorization
Compute QR Factorization
Compute Factorizations Numerically
Find Jordan Canonical Form of a Matrix
Concepts
Linear Algebra Library
Numeric Algorithms Library
Linear EquationsLinear systems of equations in matrix form
Examples and How To
Choose a Solver
Solve Algebraic Systems
Invert Matrices
Compute Determinants and Traces of Square Matrices
Compute Rank of a Matrix
Compute Determinant Numerically
Concepts
Linear Algebra Library
Numeric Algorithms Library
Properties and AssumptionsRestrict possible values of variables or expressions
Examples and How To
Use Permanent Assumptions
Use Temporary Assumptions
Concepts
Properties
When to Use Assumptions

Polynomial AlgebraPolynomials, their properties, and operations on them, orthogonal polynomials,

Groebner bases
Polynomial Creation
Create univariate and multivariate polynomials
Polynomial Manipulation
Division, factoring, decomposition, resultants, and subresultants
Elements of Polynomials
Coefficients, degrees and particular terms, monomials
Groebner Algebra
Ideals of multivariate polynomial rings over a field, Groebner bases of such ideals
Polynomial Roots
Symbolic and numeric approaches for finding polynomial roots
Properties and Assumptions
Restrict possible values of variables or expressions
Polynomial CreationCreate univariate and multivariate polynomials
Concepts
Orthogonal Polynomials
Polynomial ManipulationDivision, factoring, decomposition, resultants, and subresultants
Elements of Polynomials
Coefficients, degrees and particular terms, monomials
Groebner AlgebraIdeals of multivariate polynomial rings over a field, Groebner bases of such ideals
Concepts
Grbner bases
Polynomial RootsSymbolic and numeric approaches for finding polynomial roots
Examples and How To
Solve Equations Numerically
Concepts
Numeric Algorithms Library
Properties and AssumptionsRestrict possible values of variables or expressions
Examples and How To
Use Permanent Assumptions
Use Temporary Assumptions
Concepts
Properties
When to Use Assumptions
Mathematical Constants and FunctionsMathematical constants, complex numbers, logarithms,
exponential, trigonometric, hyperbolic, and special functions
Constants
Boolean constants, infinities, special sets of numbers
Complex Numbers
Real and imaginary components, absolute value, polar angle
Exponents and Logarithms

Exponential, logarithm, power, and root functions


Trigonometric Functions
Sine, cosine, and related functions
Hyperbolic Functions
Hyperbolic sine, cosine, and related functions
Special Functions
Collection of special mathematical functions available in MuPAD
ConstantsBoolean constants, infinities, special sets of numbers
Concepts
Mathematical Constants Available in MuPAD
Complex NumbersReal and imaginary components, absolute value, polar angle
Concepts
Floating-Point Arguments and Function Sensitivity
Exponents and LogarithmsExponential, logarithm, power, and root functions
Concepts
Floating-Point Arguments and Function Sensitivity
Trigonometric FunctionsSine, cosine, and related functions
Concepts
Floating-Point Arguments and Function Sensitivity
Hyperbolic FunctionsHyperbolic sine, cosine, and related functions
Concepts
Floating-Point Arguments and Function Sensitivity
Special FunctionsCollection of special mathematical functions available in MuPAD
Dirac and Heaviside Functions
Dirac, Kronecker delta, and step functions
Gamma Functions
Gamma and beta functions, binomial coefficients, Pochhammer symbol
Zeta Function and Polylogarithms
Zeta function, dilogarithm and polylogarithm functions
Airy and Bessel Functions
Airy and Bessel functions of the first and second kind
Exponential and Trigonometric Integrals
Trigonometric integral functions, hyperbolic integral functions, Dawson integral
Error Functions and Fresnel Functions
Error functions, inverse error functions, Fresnel integral functions
Hypergeometric and Whittaker Functions
Hypergeometric and Meijer G functions, Whittaker M and Whittaker W functions
Elliptic Integrals
Elliptic integrals and Jacobian functions
Lambert W and Wright Functions
Lambert W function (Omega function) and Wright function (omega function)

Dirac and Heaviside FunctionsDirac, Kronecker delta, and step functions


Concepts
Special Functions Available in MuPAD
Floating-Point Arguments and Function Sensitivity
Gamma FunctionsGamma and beta functions, binomial coefficients, Pochhammer symbol
Concepts
Special Functions Available in MuPAD
Floating-Point Arguments and Function Sensitivity
Zeta Function and PolylogarithmsZeta function, dilogarithm and polylogarithm functions
Concepts
Special Functions Available in MuPAD
Floating-Point Arguments and Function Sensitivity
Airy and Bessel FunctionsAiry and Bessel functions of the first and second kind
Concepts
Special Functions Available in MuPAD
Floating-Point Arguments and Function Sensitivity
Exponential and Trigonometric IntegralsTrigonometric integral functions, hyperbolic integral functions,
Dawson integral
Concepts
Special Functions Available in MuPAD
Floating-Point Arguments and Function Sensitivity
Error Functions and Fresnel FunctionsError functions, inverse error functions, Fresnel integral functions
Concepts
Special Functions Available in MuPAD
Floating-Point Arguments and Function Sensitivity
Hypergeometric and Whittaker FunctionsHypergeometric and Meijer G functions, Whittaker M and
Whittaker W functions
Concepts
Special Functions Available in MuPAD
Floating-Point Arguments and Function Sensitivity
Elliptic IntegralsElliptic integrals and Jacobian functions
Concepts
Special Functions Available in MuPAD
Floating-Point Arguments and Function Sensitivity
Lambert W and Wright FunctionsLambert W function (Omega function) and Wright function (omega
function)
Concepts
Special Functions Available in MuPAD
Floating-Point Arguments and Function Sensitivity
Numbers and PrecisionVariable-precision arithmetic, elementary number-theoretic operations
Precision Control
Control over accuracy of numeric computations

Operations on Numbers
Quotient and remainder, rounding numbers, real and imaginary components of complex numbers
Precision ControlControl over accuracy of numeric computations
Examples and How To
Compute with Numbers
Concepts
Floating-Point Arguments and Function Sensitivity
Operations on NumbersQuotient and remainder, rounding numbers, real and imaginary components
of complex numbers
Examples and How To
Compute with Numbers
Concepts
The misc Library
Numeric Algorithms Library
StatisticsAlgorithms and tools for organizing, analyzing, and modeling statistical data
Supported Distributions
Compute, fit, or generate samples
Data Import
Data import, data samples
Operations on Data Samples
Operate on rows and columns of data samples, sort samples, convert samples to lists
Descriptive Statistics
Measures of central tendency, dispersion, shape, and correlation
Statistical Visualization
View data patterns and trends
Regression Analysis
Linear and nonlinear regression
Hypothesis Testing
Goodness-of-fit tests such as Chi-square, Kolmogorov-Smirnov, Shapiro-Wilk, and t-test
Supported DistributionsCompute, fit, or generate samples
Cumulative Distribution Functions
Cumulative distribution function for continuous and discrete distributions
Probability Density Functions
Probability density function for continuous distributions
Probability Functions
Probability function for discrete distributions
Quantile Functions
Inverse cumulative distribution function for continuous and discrete distributions
Random Number Generators
Random number generator for continuous and discrete distributions

Cumulative Distribution FunctionsCumulative distribution function for continuous and discrete


distributions
Concepts
Supported Distributions
Probability Density FunctionsProbability density function for continuous distributions
Concepts
Supported Distributions
Probability FunctionsProbability function for discrete distributions
Concepts
Supported Distributions
Quantile FunctionsInverse cumulative distribution function for continuous and discrete distributions
Concepts
Supported Distributions
Random Number GeneratorsRandom number generator for continuous and discrete distributions
Concepts
Supported Distributions
Data ImportData import, data samples
Examples and How To
Import Data
Operations on Data SamplesOperate on rows and columns of data samples, sort samples, convert
samples to lists
Examples and How To
Import Data
Descriptive StatisticsMeasures of central tendency, dispersion, shape, and correlation
Examples and How To
Store Statistical Data
Compute Measures of Central Tendency
Compute Measures of Dispersion
Compute Measures of Shape
Compute Covariance and Correlation
Handle Outliers
Bin Data

Statistical VisualizationView data patterns and trends


Examples and How To
Create Scatter and List Plots
Create Bar Charts, Histograms, and Pie Charts
Create Box Plots
Create Quantile-Quantile Plots
Regression Analysis
Linear and nonlinear regression
Examples and How To

Univariate Linear Regression


Univariate Nonlinear Regression
Multivariate Regression
Hypothesis TestingGoodness-of-fit tests such as Chi-square, Kolmogorov-Smirnov, Shapiro-Wilk, and ttest
Examples and How To
Perform chi-square Test
Perform Kolmogorov-Smirnov Test
Perform Shapiro-Wilk Test
Perform t-Test
Concepts
Principles of Hypothesis Testing
Discrete MathematicsElementary number-theoretic operations, linear optimizations, graph theory,
and more
Number Theory
Primes, factorizations, modular arithmetic, congruences
Linear Optimization
Algorithms for linear and integer programming
Boolean Algebra
Boolean constants, evaluation of Boolean expressions
Graph Theory
Model pairwise relations between objects using vertices and edges
Combinatorics
Bell numbers, Catalan numbers, partitions and compositions of integers
Number TheoryPrimes, factorizations, modular arithmetic, congruences
Divisors
Study divisibility of integers
Primes
Operate on prime numbers, check and prove primality
Factorizations
Factorization of integers, factorization algorithms
Modular Arithmetic
Quotients and remainders, primitive roots, orders of residue classes, Euler's totient function, and more
Congruences
Solve linear congruences, compute modular roots
Sequences of Numbers
Bernoulli, Fibonacci, Mersenne, and other sequences of numbers
Number Theoretic Functions
Euler phi, Carmichael, Moebius, and other number theoretic functions
Conversions
ASCII encoding and decoding, continued fraction expansion
DivisorsStudy divisibility of integers

Examples and How To


Divisors
PrimesOperate on prime numbers, check and prove primality
Examples and How To
Primes and Factorizations
FactorizationsFactorization of integers, factorization algorithms
Examples and How To
Primes and Factorizations
Modular ArithmeticQuotients and remainders, primitive roots, orders of residue classes, Euler's totient
function, and more
Examples and How To
Modular Arithmetic
CongruencesSolve linear congruences, compute modular roots
Examples and How To
Congruences
Modular Arithmetic
Sequences of NumbersBernoulli, Fibonacci, Mersenne, and other sequences of numbers
Examples and How To
Sequences of Numbers
Number Theoretic FunctionsEuler phi, Carmichael, Moebius, and other number theoretic functions
ConversionsASCII encoding and decoding, continued fraction expansion
Linear OptimizationAlgorithms for linear and integer programming
Concepts
Linear Optimization
Boolean Algebra
Boolean constants, evaluation of Boolean expressions
Concepts
Linear Optimization
Boolean AlgebraBoolean constants, evaluation of Boolean expressions
Concepts
Boolean Constants
Graph TheoryModel pairwise relations between objects using vertices and edges
Creation
Create graphs, use random edge costs and weights
Modification
Add or remove edges and vertices, modify weights and costs of edges and vertices
Analysis
Costs, weights, and numbers of edges and vertices, chromatic numbers and polynomials, and other
graph characteristics
CreationCreate graphs, use random edge costs and weights
ModificationAdd or remove edges and vertices, modify weights and costs of edges and vertices

AnalysisCosts, weights, and numbers of edges and vertices, chromatic numbers and polynomials, and
other graph characteristics
CombinatoricsBell numbers, Catalan numbers, partitions and compositions of integers
Concepts
Combinatorics

GraphicsTwo- and three-dimensional plots, images, animations, data exploration, visualization


Start Here
For simplest ways to plot functions and data, see Basic Plotting. For the overview of graphical
capabilities, see Graphic Options Available in MuPAD.
2-D and 3-D Plots
Plot discrete, continuous, vector, surface, and volume data
Animations
Create animated graphics
Combining Plots
Create several plots in the same drawing area
Annotations and Appearance
Annotations, colors, axis limits, appearance, and scaling, camera and light positions
Exploration
Scale, rotate, clip, pan, or transform
Export
Export graphics to standard file formats, copy or modify a plot

2-D and 3-D Plots

Plot discrete, continuous, vector, surface, and volume data


2-D Function Plots
Plot symbolic expressions, equations, and functions in 2-D
3-D Function Plots
Plot symbolic expressions, equations, and functions in 3-D
Area Plots
Plot circles, rectangles, polygons, and more
Surfaces and Volumes
Plot spheres, cones, cylinders, prisms, pyramids, and more
Scatter Plots
Plot discrete data
Statistical Visualization
View statistical data patterns and trends
Turtle Graphics and L-Systems
Create drawings via command sequence to an abstract robot
Vector Fields
Plot vector fields and streamlines of vector fields
2-D Function PlotsPlot symbolic expressions, equations, and functions in 2-D
Examples and How To

Gallery
Easy Plotting: Graphs of Functions
Advanced Plotting: Principles and First Examples
Concepts
The Full Picture: Graphical Trees
Graphic Options Available in MuPAD
3-D Function PlotsPlot symbolic expressions, equations, and functions in 3-D
Examples and How To
Gallery
Easy Plotting: Graphs of Functions
Advanced Plotting: Principles and First Examples
Concepts
The Full Picture: Graphical Trees

Area PlotsPlot circles, rectangles, polygons, and more


Examples and How To
Gallery
Advanced Plotting: Principles and First Examples
Concepts
The Full Picture: Graphical Trees
Primitives
Surfaces and VolumesPlot spheres, cones, cylinders, prisms, pyramids, and more
Examples and How To
Gallery
Advanced Plotting: Principles and First Examples
Concepts
The Full Picture: Graphical Trees
Primitives
Scatter PlotsPlot discrete data
Examples and How To
Create Scatter and List Plots
Concepts
The Full Picture: Graphical Trees
Primitives
Statistical VisualizationView statistical data patterns and trends
Examples and How To
Create Scatter and List Plots
Create Bar Charts, Histograms, and Pie Charts
Create Box Plots
Create Quantile-Quantile Plots
Concepts
The Full Picture: Graphical Trees

Primitives

Turtle Graphics and L-SystemsCreate drawings via command sequence to an abstract robot
Examples and How To
Gallery
Concepts
The Full Picture: Graphical Trees
Primitives
Vector FieldsPlot vector fields and streamlines of vector fields
Examples and How To
Gallery
Advanced Plotting: Principles and First Examples
Concepts
The Full Picture: Graphical Trees
Primitives
AnimationsCreate animated graphics
Examples and How To
Create Animated Graphics
Animations
Combining PlotsCreate several plots in the same drawing area
Examples and How To
Layout of Canvas and Scenes
Groups of Primitives
Annotations and AppearanceAnnotations, colors, axis limits, appearance, and scaling, camera and
light positions
Colors
Colors, palettes, and patterns
3-D Scene Control
Positions of cameras and lights, focal points, light sources and intensity
Drawing Area
Legends, titles, dimensions and position of drawing area, comments and pictures in drawing area
Coordinate System
Appearance of axes, grid lines, and tick marks
Plot Style and Settings
Appearance of lines, points, surfaces, and arrows
Animation Settings
Style, timing, and visibility settings
Default Settings
Display or modify default settings of attributes
ColorsColors, palettes, and patterns
Concepts
Colors
3-D Scene ControlPositions of cameras and lights, focal points, light sources and intensity

Concepts
Cameras in 3D
Possible Strange Effects in 3D
Attributes
Drawing AreaLegends, titles, dimensions and position of drawing area, comments and pictures in
drawing area
Annotation
Fonts, legends, titles, text alignment
Layout
Height, width, margins, space between plots appearing in the same drawing area
External Pictures in MuPAD Plots
Display pictures not generated by MuPAD
AnnotationFonts, legends, titles, text alignment
Examples and How To
Fonts
Legends
Concepts
Attributes
LayoutHeight, width, margins, space between plots appearing in the same drawing area
Examples and How To
Layout of Canvas and Scenes
Concepts
Attributes
External Pictures in MuPAD PlotsDisplay pictures not generated by MuPAD
Examples and How To
Import Pictures
Coordinate SystemAppearance of axes, grid lines, and tick marks
Axes
Positions, decorations, titles, visibility
Grid Lines
Positions, color, width, style, visibility
Tick Marks
Positions, labels, visibility
AxesPositions, decorations, titles, visibility
Concepts
Attributes
Grid LinesPositions, color, width, style, visibility
Concepts
Attributes
Tick MarksPositions, labels, visibility
Concepts

Attributes

Plot Style and SettingsAppearance of lines, points, surfaces, and arrows


Line Style
Width, style, color, gradient color and its direction, visibility
Point Style
Color, style, size, visibility
Surface Style
Color, pattern, shadow, appearance of bars on histograms
Arrow Style
Appearance of arrowheads on 2-D and 3-D plots
Plot Settings
Tolerance and adaptive mesh for numeric approximations, handling discontinuities, asymptotes
Line StyleWidth, style, color, gradient color and its direction, visibility
Concepts
Attributes
Point StyleColor, style, size, visibility
Concepts
Attributes
Surface StyleColor, pattern, shadow, appearance of bars on histograms
Concepts
Attributes
Arrow StyleAppearance of arrowheads on 2-D and 3-D plots
Concepts
Attributes
Plot SettingsTolerance and adaptive mesh for numeric approximations, handling discontinuities,
asymptotes
Concepts
Attributes
Animation SettingsStyle, timing, and visibility settings
Examples and How To
Animations
Default SettingsDisplay or modify default settings of attributes
Concepts
Attributes
ExplorationScale, rotate, clip, pan, or transform
Examples and How To
Viewer, Browser, and Inspector: Interactive Manipulation
Transformations
ExportExport graphics to standard file formats, copy or modify a plot
Examples and How To
Save and Export Pictures

Programming BasicsProcedures, control flow, interactive input


Start Here
To write a simple function, see Functions.
Control Flow
Conditional statements, loops, branching
Functions and Procedures
Write basic functions and procedures
Interactive Input
Request interactive input
Control FlowConditional statements, loops, branching
Examples and How To
Conditional Control
Loops
Shortcut for Closing Statements
Functions and ProceduresWrite basic functions and procedures
Examples and How To
Procedures
Functions
Shortcut for Closing Statements
Interactive InputRequest interactive input

Data and File ManagementData import and export, file operations and locations
Data Import and Export
Import text and bitmap data, export data in STL format
File Operations
Interact with system files and folders, set paths
Operating System Commands
Interact with operating system from MuPAD
Data Import and ExportImport text and bitmap data, export data in STL format
Examples and How To
Import Data
Concepts
The import Library

File OperationsInteract with system files and folders, set paths


Concepts
Set Engine Preferences

Operating System CommandsInteract with operating system from MuPAD

Advanced Software DevelopmentObject-oriented programming, error handing, code


performance, tests, integrating custom functionality into MuPAD
Functional Programming
Higher-order functions and other utilities for functional programming
Debugging
Diagnose problems in MuPAD programs

Code Performance
Profile and improve performance
Memory Usage
Analyze and improve memory usage
Error Handling
Generate warnings and errors, capture data on cause of error
Testing and Code Verification
Write single tests and test scripts
Custom Functionality Integration
Seamless integration of new functions into MuPAD
Object-Oriented Programming
Object-oriented programming with MuPAD
Functional ProgrammingHigher-order functions and other utilities for functional programming
Examples and How To
Access Arguments of a Procedure
Test Arguments
Verify Options
Data Collection
Variables Inside Procedures
Utility Functions
Private Methods
Calls by Reference and Calls by Value
Concepts
Functional Programming
The misc Library
DebuggingDiagnose problems in MuPAD programs
Examples and How To
Debug MuPAD Code Using the Debugger
Debug MuPAD Code in the Tracing Mode
Edit MuPAD Code in MATLAB Editor
Display Progress
Use Assertions
Code PerformanceProfile and improve performance
Examples and How To
Measure Time
Profile Your Code
Concepts
When to Analyze Performance
Techniques for Improving Performance
Memory UsageAnalyze and improve memory usage
Examples and How To
Display Memory Usage

Remember Mechanism
History Mechanism
Error HandlingGenerate warnings and errors, capture data on cause of error
Examples and How To
Write Error and Warning Messages
Handle Errors
Testing and Code VerificationWrite single tests and test scripts
Examples and How To
Write Single Tests
Write Test Scripts
Code Verification
Concepts
Why Test Your Code

Custom Functionality Integration Seamless integration of new functions into MuPAD

Examples and How To


Protect Function and Option Names
Integrate Custom Functions into MuPAD
Object-Oriented ProgrammingObject-oriented programming with MuPAD
Domains
MuPAD definition of data types
Categories
Categories and category constructors implemented in MuPAD
Axioms
Axioms and axiom constructors implemented in MuPAD
DomainsMuPAD definition of data types
Basic Domains
Basic domains written in C++
Library Domains
Library domains written in MuPAD
Abstract Data Types
Abstract data types implemented in MuPAD
Domain Operations
Define new domains, domain elements, methods and entries of domains, access and substitute
operands of domain elements
Basic DomainsBasic domains written in C++
Examples and How To
Choose Appropriate Data Structures
Convert Data Types
Define Your Own Data Types
Concepts
Data Type Definition
Library DomainsLibrary domains written in MuPAD

Examples and How To


Choose Appropriate Data Structures
Convert Data Types
Define Your Own Data Types
Concepts
Data Type Definition
Abstract Data TypesAbstract data types implemented in MuPAD
Concepts
Abstract Data Types Library
Domain OperationsDefine new domains, domain elements, methods and entries of domains, access and
substitute operands of domain elements
Examples and How To
Define Your Own Data Types
Concepts
Data Type Definition
CategoriesCategories and category constructors implemented in MuPAD
Concepts
Categories
AxiomsAxioms and axiom constructors implemented in MuPAD
Concepts
Axioms

Code GenerationUse symbolic results in MATLAB, Simulink, Simscape, C, Fortran, TeX, and
MathML
Examples and How To
Create MATLAB Functions from MuPAD Expressions
Create MATLAB Function Blocks from MuPAD Expressions
Create Simscape Equations from MuPAD Expressions

Notebook InterfaceMuPAD notebook interface with embedded text, graphics, and typeset math
to document and manage computations performed in the MuPAD language
Typeset Math and Other Output Modes
Typeset, ASCII, or plain text math, abbreviations, line length
Keyboard Shortcuts
Key combinations to perform common tasks
Customizations and Preferences
Adjust MuPAD interfaces for your convenience
Presentations
Create class notes, textbooks, and interactive presentations embedding graphics, animations, and
descriptive text in MuPAD notebooks
Version
Information about current product version
Typeset Math and Other Output ModesTypeset, ASCII, or plain text math, abbreviations, line length
Examples and How To

Use Different Output Modes


Set Line Length in Plain Text Outputs
Greek Letters in Text Regions
Special Characters in Outputs
Non-Greek Characters in Text Regions
Keyboard ShortcutsKey combinations to perform common tasks
Examples and How To
Use Keyboard Shortcuts
Use Mnemonics
Customizations and PreferencesAdjust MuPAD interfaces for your convenience
Examples and How To
Arrange Toolbars and Panes
Enter Data and View Results
View Status Information
Save Custom Arrangements
Set Preferences for Notebooks
Set Preferences for Dialogs, Toolbars, and Graphics
Set Font Preferences
Set Engine Preferences
Set Line Length in Plain Text Outputs
Concepts
Notebook Overview
Debugger Window Overview
PresentationsCreate class notes, textbooks, and interactive presentations embedding graphics,
animations, and descriptive text in MuPAD notebooks
Examples and How To
Wrap Long Lines
Hide Code Lines
Delete Outputs
Change Font Size Quickly
Scale Graphics
Use Print Preview
Change Page Settings for Printing
Print Wide Notebooks
Concepts
Overview
VersionInformation about current product version
Examples and How To
Get Version Information

MATLAB and MuPAD Integration


MuPAD Function CallsCall MuPAD functions and procedures from MATLAB Workspace
Examples and How To

Call Built-In MuPAD Functions from MATLAB


Use Your Own MuPAD Procedures
Source Code of the MuPAD Library Functions
Concepts
Differences Between MATLAB and MuPAD Syntax
Reserved Variable and Function Names
MuPAD Files and Interfaces
Open MuPAD notebooks, program files, and graphics from MATLAB
Examples and How To
Create MuPAD Notebooks
Open MuPAD Notebooks
Save MuPAD Notebooks
Evaluate MuPAD Notebooks from MATLAB
Close MuPAD Notebooks from MATLAB
Concepts
Computations in MATLAB Command Window vs. MuPAD Notebook App
Notebook Files and Program Files

Variables and Expressions ExchangeCopy variables and expressions along with their values
between MATLAB and MuPAD
Examples and How To
Copy Variables and Expressions Between MATLAB and MuPAD
Concepts
Reserved Variable and Function Names

MuPAD Engine CommandsControl MuPAD engine from MATLAB


Examples and How To
Clear Assumptions and Reset the Symbolic Engine
Concepts
MuPAD Engines and MATLAB Workspace

Вам также может понравиться