Session 9: Symbolic variables and Context

To set block parameters, any Scilab variable or expression can be used. The only constraint is that the variables de defined in the current environment when used. These variables can be defined in the Context of the diagram.

Construct the following diagram
The u^3 block computes the third power of the input; 3 is a block parameter
Define the context of the diagram as follows
    Context in  the Edit menu should be used to open the context of the diagram.
The variables alph and beta are now defined and can be used as parameter

Set Constant block parameter to alph and the Power block parameter to beta
    The parameter of the Constant block for example should be set as follows
This parameter is stored symbolically

The diagram after parameter changes looks like

The values of alph and beta are defined in the Context

To change the value of these parameters, it is enough to update the Context. Symbolic definition is particularly useful when the same variable is used in more than one place in the diagram. Changing the value of this variable in the Context changes the parameter values of all the blocks in which this variable used.

Every Super Block has a Context of its own. A variable defined in the Context of a diagram can be used to set block parameters of the blocks in the diagram. Even if a variable is not defined in the Context of the Super Block, it can be used if it is defined in the Context of the diagram containing the Super Block, or in the Context of the Super Block containing the Super Block containing the Super Block, and so on. In case of multiple defintion, the value is the value defined in the Context closet to the diagram.





Here ends the tutorial.     I want to go back

For more information about Scicos, send an e-mail to Doctor Scilab: Scilab@inria.fr


 
 
For suggestions about this Web server, send an e-mail to Scilab@inria.fr