break
The break keyword immediately terminates a for or while loop.
for j = 1:10
disp(j)
if j == 3
break
end
end
1
2
3
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.
Loops are used to perform the same set of statements multiple times. The for loop runs the statements a set number of times based on the number of elements in the collection found on the first line of the for loop.
Parfor loops behave similarly to regular for loops except that they attempt to use multiple processors or threads to divide the loop space into chunks. The chunks are equally-sized (or as equal as possible).
The break keyword immediately terminates a for or while loop.
Loops are used to perform the same set of statements multiple times. The while loop runs the statement until a condition is no longer met.
OpenMatrix language supports conditional execution of statements using the if/elseif/else construct.
OpenMatrix Language also supports a variant of this using switch/case/otherwise.
The try /catch block allows you to stop errors from being returned, and allows another block of code to execute instead of the error.
There are two types of workspaces: Local and Global.
Functions are packets of statements that can be used repeatedly.
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.
Get help for the optional libraries that are available in the Extension Manager.
You've got questions? We've got answers!
OpenMatrix is a mathematical scripting language.
Reference guides are available for functions and commands supported by OML, Tcl, and Python.
Loops are used to perform the same set of statements multiple times.
The break keyword immediately terminates a for or while loop.
ON THIS PAGE
The break keyword immediately terminates a for or while loop.
for j = 1:10
disp(j)
if j == 3
break
end
end
1
2
3
ON THIS PAGE
(c) 2025 Altair Engineering, Inc. All rights reserved.