Common Operations

Create and modify data structures, access and count their elements

Note

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

To convert a MuPAD notebook file to a MATLAB live script file, see convertMuPADNotebook. MATLAB live scripts support most MuPAD functionality, although there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

MuPAD Functions

.Concatenate objects
..Range operator
assignPerform assignments given as equations
assignElementsAssign values to entries of an array, a list, or a table
lengthThe “length” of a object (heuristic complexity)
matchPattern matching
nopsNumber of operands
opOperands of an object
piecewiseDomain of conditionally defined objects
selectSelect operands
splitSplit an object
sysorderCompare objects according to the internal order
tableCreate a table
numeric::indetsSearch for indeterminates
prog::exprtreeVisualize an expression as tree
prog::findFind operands of objects
prog::sortSort objects by an index function

Topics

Sequences

Sequences represent one of the basic data structures.

Lists

Lists represent ordered data structures.

Sets

Sets represent unordered mathematical structures.

Tables

Tables associate arbitrary indices with arbitrary values.

Arrays

Arrays represent multidimensional data structures.

Vectors and Matrices

The simplest way to create a matrix in MuPAD is to use the matrix command:

Choose Appropriate Data Structures

When you create a new MuPAD object, you choose the domain type of that object either explicitly or implicitly.

Data Collection

Suppose the data that you want to collect is generated element-by-element and you know in advance how many elements will be generated.