Clearing Functions
Use the clear command (passing the function name as an argument) to clear (delete) a function from the session and make it inaccessible.
Alternatively, redefining a function implicitly deletes its previous definition.
Discover new features and enhancements.
Discover Compose, including its language support and system requirements.
The Compose tutorials and associated example model files help introduce you to the basic functionality of the software.
Learn about the features and functionality available in Compose.
Reference guides are available for functions and commands supported by OML, Tcl, and Python.
OpenMatrix is a mathematical scripting language.
Literals are items that are constant throughout the life of the application. Literals include numeric, imaginary, characters, strings, logicals, and Other (NaN/Inf).
Data types are items that are constant throughout the life of the application and are built into the OpenMatrix language.
Strings are arrays of characters.
OML language scripts manipulate data through variables. Variables are referred to by their name (alphanumeric) and can be created (assigned) and deleted as described in this section.
Indexing is used to retrieve one or more specific values out of a collection.
Operators are used to combine operands.
Each operator in this section is explained with the operations of scalars, vectors, and matrices that are allowed for said operator.
Statements are made of expressions, which may be simple or complex.
Loops are used to perform the same set of statements multiple times.
There are two types of workspaces: Local and Global.
Functions are packets of statements that can be used repeatedly.
Anonymous functions can be defined anywhere inside a script.
Use the clear command (passing the function name as an argument) to clear (delete) a function from the session and make it inaccessible.
Eval is a special function that accepts a string that is itself an OML script. The function evaluates the script and returns the appropriate value.
Functions are packets of statements that can be used repeatedly. They can accept any number of inputs and can return any number of outputs.
Define functions using the function keyword.
If a function is defined in its own file, the function name must match the file name.
There are two special identifiers, nargin and nargout, that indicate the number of parameters passed into and the number of parameters returned from the function respectively.
Nested functions are functions within the main function.
Function arguments are passed by values in OpenMatrix language functions calls.
The function body can include calls to other functions and calls to itself. This is referred to as recursion.
Return is a special keyword that is only available in functions. It immediately ends the function.
Functions can be written to accept or return an indefinite (or 'variable') number of arguments. To do so, use the varargin and varargout variables.
OpenMatrix statements persist in .oml files.
This section describes files that can be manipulated by the OpenMatrix Language.
Errors and warning messages are both output in the console (or the Command Window in GUI mode) of Compose.
Create 2D and 3D plots and control their style and appearance.
Objects in OML are defined using the classdef keyword. This creates a blueprint for an object but does not actually create (instantiate) anything.
The Reference Guide contains documentation for all functions supported in the OpenMatrix language.
You've got questions? We've got answers!
Reference guides are available for functions and commands supported by OML, Tcl, and Python.
OpenMatrix is a mathematical scripting language.
Functions are packets of statements that can be used repeatedly.
Use the clear command (passing the function name as an argument) to clear (delete) a function from the session and make it inaccessible.
Use the clear command (passing the function name as an argument) to clear (delete) a function from the session and make it inaccessible.
Alternatively, redefining a function implicitly deletes its previous definition.
© 2022 Altair Engineering, Inc. All Rights Reserved.
Intellectual Property Rights Notice | Technical Support | Cookie Consent