beginContext
Start a new context in which the variables and their values are stored.
beginContext(contextName)
| Inputs |
contextName |
A string which is the name of the context. |
Description
Any variables definitions bracketted by this call
and a subsequent call to endContext will be stored
in a context with the specified name.
The variables defined in the context may be later
made accessible by making a call to beginContext with the same
context name as the argument.
Note that the contexts defined within a function in this manner
are local,
and are not available when the function terminates. Also,
the variables in the enclosing context can be accessed by using
the function evalin or evalInCaller() .
Example
>>a=2;
>>beginContext("newContext");
>>b=a+2;
>>endContext();
>>b // b is still undefined in the context.
null
>>beginContext("newContext");
>>b
4
>>endContext();