unprotect

Remove protection of identifiers

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

unprotect(x)

Description

unprotect(x) removes any write protection of the identifier x.

unprotect(x) is equivalent to protect(x, ProtectLevelNone).

unprotect does not evaluate its argument. Cf. Example 2.

Examples

Example 1

unprotect allows to assign values to system functions:

unprotect(sign): sign(x) := 1

However, we strongly advise not to change identifiers protected by the system. We undo the previous assignment:

delete sign(x): protect(sign, ProtectLevelError):

Example 2

unprotect does not evaluate its argument. Here the identifier x is unprotected and not its value y:

x := y:  protect(y): unprotect(x): y := 1
Warning: The protected variable 'y' is overwritten. [_assign]

 Warning: Protected variable
'y' overwritten. [_assign] 

unprotect(y): delete x, y:

Example 3

The identifier a is protected with various levels. unprotect returns the previous protection level:

protect(a):
unprotect(a)

protect(a, ProtectLevelError):
unprotect(a)

At this place, a is not protected:

unprotect(a)

Parameters

x

An identifier

Return Values

Previous protection level of x: either ProtectLevelError or ProtectLevelWarning or ProtectLevelNone (see protect).

See Also

MuPAD Functions

Was this topic helpful?