Waveform Generator
Output waveforms using signal notations
Description
The Waveform Generator block outputs waveforms based on signal notations that you enter in theWaveform Definitiontable.
This block supports these syntaxes for the signal notations:
Function syntax — Specify all arguments in the specific order for the signal syntax (seeAlgorithms).
Name-value syntax — Specify optional comma-separated pairs of
Name,Value
arguments.Name
is the argument name andValue
is the corresponding value.Name
must appear inside single quotes (' '
). You can specify several name and value pair arguments in any order asName1,Value1,...,NameN,ValueN
.For more information, seeAlgorithms.
This block supports normal, accelerator, and rapid accelerator modes and fast restart.
Supported Operators
Operation | Operator |
---|---|
Absolute value |
abs() |
Addition |
+ |
Division |
/ |
Multiplication |
* |
Parentheses |
() |
Subtraction |
- |
Unary minus |
- |
The Waveform block observes the following rules of operator precedence:
( )
+ -
(unary)* /
+ -
Supported Operations
TheWaveform Generatorblock outputs one signal at a time. You can change this output signal. Express frequency and phase offset parameters in radians. You can also:
Nest signal notations, for example:
sin('Amplitude',sin('Amplitude',1,'Frequency',1,'Phase',0),'Frequency',1,'Phase',1)
Reference real scalar variables in the base or model workspace, for example:
sin('Amplitude',x,'Frequency',y,'Phase',z)
x,y, andzexist in the base workspace.
For more information on waveforms, see the Algorithms section.
To quickly determine the response of a system to different types of inputs, you can vary the output signal of theWaveform Generatorblock while a simulation is in progress.
![](http://www.tianjin-qmedu.com/help/releases/R2018a/simulink/slref/waveform_gen_icon.png)
Limitations
You cannot tune the parameters of a waveform, such as frequency or amplitude, during execution of the code that you generate by using万博1manbetx®Coder™.相反,您可以允许您生成代码to switch between waveform variants that you specify. For more information, seeSwitch Between Output Waveforms During Code Execution for Waveform Generator Block(Simulink Coder).