Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

blockTransparent

Create a transparent block protected against evaluation

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

blockTransparent(a)

Description

blockTransparent(a) creates a transparent block, which is left unchanged by evaluation, but treated as expression with the same operands as a.

blockTransparent is a domain. If d is any block domain, d(a) creates a block belonging to that domain, with content a.

blockTransparent(a) puts its argument into a block, without evaluating it. In order to evaluate a normally before putting it into a block of some kind, use eval(hold(blockTransparent)(a)).

Transparent blocks are invariant under evaluation, but such blocks have the same operands as their content.

Sequences can also be put into block. In the case of blockTransparent, they are not flattened. See Example 2.

The call expr(b) replaces all transparent blocks in b by their content, without evaluating that content. Thus, expr(blockTransparent(a)) is similar to hold(a).

In case of nested blocks, only the outermost block is removed by both expr and unblock.

Examples

Example 1

A block, including transparent blocks, is a sort of container that protects its content against evaluation:

y := 2:
bl := blockTransparent(x + y + z)

Transparent block allow access to the operands of its content:

op(bl,1), subs(bl, hold(y) = y)

delete bl, y

Example 2

A block can also contain a sequence; flattening is suppressed:

blockTransparent((x, y),z)

Example 3

The content of a block can be extracted and evaluated using unblock:

bl := blockTransparent(x + y):
[x, y] := [1, 2]:
bl

unblock(bl)

delete y

Parameters

a

Any object or sequence of objects

Return Values

blockTransparent creates objects of its own type.

See Also

MuPAD Functions

Was this topic helpful?