# Function (editor)

A function within COSSAN is used to define mathematical relations between random variables and parameters. All basic algebraic operations and most mathematical functions are supported in this regard. The value of the function is then evaluated by using the realizations of the random variables for each simulation.

## Contents

The name and description of the Function can be set or changed from what has been defined in the wizard.

### Function definition

The mathematical relation defining the Function is inserted here. The name of the random variable or parameter to be used in the function evaluation must be inserted using the following tag:

``` <&xxx&>
```

### Examples

• Matrix addition. A and B must have the same dimensions
```<%A%>+<%B%>
```
• Matrix subtraction. A and B must have the same dimensions
```<%A%>+<%B%>
```
• Array multiplication. A.*B is the entry-by-entry product of A and B. A and B must have the same dimensions
```<%A%>.*<%B%>
```
• Array left division. A.\B is the matrix with entries B(i,j)/A(i,j). A and B must have the same dimensions
```<%A%>.\<%B%>
```
• Array right division. A./B is the matrix with entries A(i,j)/B(i,j). A and B must have the same dimensions
```<%A%>./<%B%>
```
• Array power. A.^B is the matrix with entries A(i,j)^B(i,j). A and B must have the same dimensions,
```<%A%>.^<%B%>
```