The Test Sequence block uses MATLAB^{®} as the
action language. You can use functions to generate signal outputs
to the component under test.

Define an output data symbol in the

**Data Symbols**pane.Use the output name with a signal generation function in the test step action.

In this test sequence, the step `Sine`

outputs
a sine wave with a period of `10`

seconds, specified
by the argument `et*2*pi/10`

. The step `Random`

outputs
a random number in the interval `-0.5`

to `0.5`

.

You can also define a function in a script on the MATLAB path,
and call the function in the Test Sequence block. In
this test sequence, the `ReducedSine`

step reduces `SignalOut`

using
the function `Attenuate`

.

function[y] = Attenuate(x) y = 0.65*x; end

Generate test signals using output functions. Some output functions use the temporal operator
`et`

, which is the elapsed time of the test step in seconds.

Function outputs are not constrained to provide a defined pattern. Scaling, rounding, and other approximations of argument values can affect function outputs.

Common output functions include:

Function | Syntax | Description | Example |
---|---|---|---|

`square` | `square(x)` | Represents a square wave output with a period of Within
the interval | Output a square wave with a period of square(et/10) |

`sawtooth` | `sawtooth(x)` | Represents a sawtooth wave output with a period of Within
the interval | Output a sawtooth wave with a period of sawtooth(et/10) |

`triangle` | `triangle(x)` | Represents a triangle wave output with a period of Within
the interval | Output a triangle wave with a period of triangle(et/10) |

`ramp` | `ramp(x)` | Represents a ramp signal of slope
| Ramp one unit for every 5 seconds of test step elapsed time: ramp(et/5) |

`heaviside` | `heaviside(x)` | Represents a heaviside step signal, returning | Output a heaviside signal after heaviside(et-5) |

`latch` | `latch(x)` | Saves the value of | Latch b = latch(torque) |

`sin` | `sin(x)` | Returns the sine of | A sine wave with a period of 10 sec: sin(et*2*pi/10) |

`cos` | `cos(x)` | Returns the cosine of | A cosine wave with a period of 10 sec: cos(et*2*pi/10) |

`rand` | `rand` | Uniformly distributed pseudorandom number. | Generate values from the uniform distribution on the
interval a + (b-a)*rand |

`randn` | `randn` | Normally distributed pseudorandom number. |
Generate values from a normal distribution with mean
1 + 2*randn(100,1) |

`exp` | `exp(x)` | Returns the natural exponential function, $${e}^{x}$$. | An exponential signal progressing at one tenth of the test step elapsed time: exp(et/10) |

Syntax for Test Sequences and Assessments | Test Sequence

Was this topic helpful?