Signal Editor
Display, create, edit, and switch interchangeable scenarios
- Library:
Simulink / Sources
Description
The Signal Editor block displays, creates, and edits interchangeable scenarios. You can also use the block to switch scenarios in and out of models.
The Signal Editor block supports MAT-files that contain one or more
scalar Simulink.SimulationData.Dataset
objects.
You can port Signal Builder block configurations to the Signal
Editor block using the signalBuilderToSignalEditor
function. For more information, see Replace Signal Builder Block with Signal Editor Block.
To programmatically get the total number of scenarios and signals in the Signal
Editor block, use the get_param
NumberOfScenarios
and NumberOfSignals
properties.
These properties contain the values as character vectors. To convert these values to
doubles, use the str2double
function.
To programmatically enable the Signal Editor block to label output
signal lines, set the set_param
PreserveSignalName
to 'on'
(default). For
example:
set_param(gcb,'PreserveSignalName','on')
Fast Restart
The Signal Editor block supports fast restart. With fast restart enabled, you can still:
Change the active scenario.
Change the active signal.
While you can change the active signal, you cannot edit the signal properties in the block.
Start the Signal Editor user interface and edit data.
Limitations
The Signal Editor block does not support:
Function-calls
Ground signals
The Signal Editor block supports dynamic strings. It does not support strings with maximum length. In addition, strings in the Signal Editor block cannot output:
Non-scalar MATLAB strings.
String data that contains missing values.
String data that contains non-ASCII characters.
Ports
Output Arguments
Signal1
— Signals in scenario
multidimensional
One or more signals, which can be:
A MATLAB®
timeseries
objectA structure of MATLAB
timeseries
objectsA two-dimensional matrix
The port label depends on the associated variable in the data set MAT-file.
Data Types: single
| double
| half
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| string
| Boolean
| fixed point
| enumerated
| bus
Parameters
File name
— Data set file
untitled.mat
(default) | character vector
Data set file, specified as character vector, containing one or more
scalar Simulink.SimulationData.Dataset
objects. Do not
use a file name from one locale in a different locale. When using the block
on multiple platforms, consider specifying just the MAT-file name and having
the MAT-file be on the MATLAB path.
Dependencies
If
untitled.mat
does not exist in the current folder, these parameters are disabled:Active scenario
Signals
Output a bus signal
Unit
Sample time
Interpolate data
Enable zero-crossing detection
Form output after final data value by
To create a MAT-file, click
. This button starts the Signal Editor user interface, which lets you create and edit scenario MAT-files.
Programmatic Use
Block Parameter:
Filename |
Type: character vector |
Values: character vector |
Default:
'untitled.mat' |
Active scenario
— Active scenario
Scenario
(default) | character vector
Active scenario, specified as a character vector. The specified MAT-file must exist. You can switch the active scenario as necessary.
Dependencies
To enable this parameter, ensure that the specified MAT-file exists.
Programmatic Use
Block Parameter:
ActiveScenario |
Type: character vector | numeric |
Values: character vector | index value |
Default:
'Scenario' |
To create and edit scenarios, launch Signal Editor user interface
— Start Signal Editor
button click
To start Signal Editor user interface, click .
Active signal
— Signal to configure
Signal 1
(default) | character vector
Signal to configure, specified as a signal name. This signal is considered the active signal. The MAT-file must exist before you can configure signals.
To enable this parameter, ensure that the specified MAT-file exists.
Tip
Do not use the set_param
function to set the
active signal property Name-Value argument
('ActiveSignal'
) in combination with another
Name-Value pair argument for the Signal Editor
block.
Programmatic Use
Block Parameter:
ActiveSignal |
Type: character vector | numeric |
Values: character vector | index vector |
Default: 'Signal
1' |
Output a bus signal
— Configure signal as bus
off (default) | on
Configure signal as a bus:
On
Configure signal as a bus.
Off
Do not configure signal as a bus.
The specified MAT-file must exist.
Tip
Select this check box only if the active signal is a MATLAB structure whose fields are the same as an existing bus object, or create a new matching bus object. If you select this check box for an active signal that is not a MATLAB structure, simulation returns an error.
Dependencies
Selecting Output a bus signal check box enables the Select bus object parameter.
To enable this parameter, ensure that the specified MAT-file exists.
Programmatic Use
Block Parameter:
IsBus |
Type: character vector |
Values: 'off' |
'on' |
Default:
'off' |
Select bus object
— Bus object
Bus: BusObject
(default) | bus object name
Select or enter the bus object name. To edit the bus object or create a bus object using the Data Type Assistant, click >>. The active signal must be a MATLAB structure whose fields are the same as this bus object. The specified MAT-file must exist.
Dependencies
To enable this parameter, ensure that the specified MAT-file exists.
Programmatic Use
Block Parameter:
OutputBusObjectStr |
Type: character vector |
Values: bus object name |
Default: 'Bus:
BusObject' |
Mode
— Bus object mode
Bus Object
(default) | bus object data type
Select the bus object name. If you do not have a bus object, create one by clicking Edit, which starts the Type Editor. For more information, see Create and Specify Simulink.Bus Objects.
Unit
— Physical unit
inherit (default) | supported physical unit
Physical unit of the signal, specified as an allowed unit. To specify a unit, begin typing in the text box. As you type, the parameter displays potential matching units. For more information, see Unit Specification in Simulink Models. For a list of supported units, see Allowed Unit Systems.
To constrain the unit system, click the link to the right of the parameter:
If a Unit System Configuration block exists in the component, its dialog box opens. Use that dialog box to specify allowed and disallowed unit systems for the component.
If a Unit System Configuration block does not exist in the component, the model Configuration Parameters dialog box displays. Use that dialog box to specify allowed and disallowed unit systems for the model.
The specified MAT-file must exist.
Dependencies
To enable this parameter, ensure that the specified MAT-file exists.
Programmatic Use
Block Parameter:
Unit |
Type: character vector |
Values:
'inherit' | supported physical unit |
Default:
'inherit' |
Sample time
— Time interval between samples
0
(default) | -1
| sample time in seconds
Time interval between samples, specified in seconds. The specified MAT-file must exist.
Dependencies
To enable this parameter, ensure that the specified MAT-file exists.
Programmatic Use
Block Parameter:
SampleTime |
Type: character vector |
Values: -1 |
sample time in seconds |
Default:
'0' |
Interpolate data
— Linearly interpolate data
off (default) | on
Linearly interpolate data at time hits for which no corresponding workspace data exist. The specified MAT-file must exist.
The Signal Editor block linearly interpolates:
On
Linearly interpolate at time hits for which no corresponding workspace data exist, select this option.
Off
The current output equals the output at the most recent time for which data exists.
The Signal Editor block interpolates by using the two corresponding workspace samples:
For
double
data, linearly interpolates the value by using the two corresponding samplesFor
Boolean
data, usesfalse
for the first half of the time between two time values andtrue
for the second halfFor a built-in data type other than
double
orBoolean
:Upcasts the data to
double
Performs linear interpolation (as described for
double
data)Downcasts the interpolated value to the original data type
You cannot use linear interpolation with enumerated
(enum
) data.
The block uses the value of the last known data point as the value of time hits that occur after the last known data point.
To determine the block output after the last time hit for which data is available, combine the settings of these parameters:
Interpolate data
Form output after final data value by
For details, see the Form output after final data value by parameter.
Dependencies
To enable this parameter, ensure that the specified MAT-file exists.
Programmatic Use
Block Parameter:
Interpolate |
Type: character vector |
Values: 'off' |
'on' |
Default:
'off' |
Enable zero-crossing detection
— Detect zero-crossings
off (default) | on
If you select the Enable zero-crossing detection parameter, then when the input array contains multiple entries for the same time hit, Simulink® detects a zero crossing. For example, suppose that the input array has this data:
time: 0 1 2 2 3 signal: 2 3 4 5 6
At time 2, there is a zero crossing from input signal discontinuity. For more information, see Zero-Crossing Detection.
For bus signals, Simulink detects zero crossings across all leaf bus elements.
The specified MAT-file must exist.
Dependencies
To enable this parameter, ensure that the specified MAT-file exists.
Programmatic Use
Block Parameter:
ZeroCross |
Type: character vector |
Values: 'off' |
'on' |
Default:
'off' |
Form output after final data value by
— Block output after the last time hit for which data is available
Setting to zero
(default) | Extrapolation
| Holding final value
To determine the block output after the last time hit for which workspace data is available, combine the settings of these parameters:
Interpolate data
Form output after final data value by
This table lists the block output, based on the values of the two options.
Setting for Form Output After Final Data Value By | Setting for Interpolate Data | Block Output After Final Data |
---|---|---|
Extrapolation |
On |
Extrapolated from final data value |
Off |
Error | |
Setting to zero |
On |
Zero |
Off |
Zero | |
Holding final value |
On |
Final value from workspace |
Off |
Final value from workspace |
For example, the block uses the last two known data points to extrapolate data points that occur after the last known point if you:
Select Interpolate data.
Set Form output after final data value by to
Extrapolation
.
The specified MAT-file must exist.
Dependencies
To enable this parameter, ensure that the specified MAT-file exists.
Programmatic Use
Block Parameter:
OutputAfterFinalValue |
Type: character vector |
Values: 'Setting to
zero' | 'Extrapolation' | 'Holding final
value' |
Default: 'Setting to
zero' |
Model Examples
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Not recommended for production code.
PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.
Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.
Version History
Introduced in R2017b
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)