;, :, _stmtseq

Statement sequences

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.


object1; object2; ...
object1: object2: ...
_stmtseq(object1, object2, …)


The function call _stmtseq (object1, object2, ...) is equivalent to the statement sequence (object1; object2; ...).

The function call _stmtseq (object1, object2, ...) evaluates the statements (object1; object2; ...) from left to right.

_stmtseq () returns the void object of type DOM_NULL.


Example 1

Usually, statements are entered imperatively:

x := 2; x := x^2 + 17; sin(x + 1)

This sequence of statements is turned into a single command (a "statement sequence") by enclosing it in brackets. Now, only the result of the "statement sequence" is printed. It is the result of the last statement inside the sequence:

(x := 2; x := x^2 + 17; sin(x + 1))

Alternatively, the statement sequence can be entered via _stmtseq. For syntactical reasons, the assignments have to be enclosed in brackets when using them as arguments for _stmtseq. Only the return value of the statement sequence (the return value of the last statement) is printed:

_stmtseq((x := 2), (x := x^2 + 17),  sin(x + 1))

Statement sequences can be iterated:

x := 1: (x := x + 1; x := x^2; print(i, x)) $ i = 1..4

delete x:


object1, object2, …

Arbitrary MuPAD® objects and statements

Return Values

Return value of the last statement in the sequence.

See Also

MuPAD Functions

Was this topic helpful?