Create and Edit Signal Data
Use the Signal Editor to create and edit input signals that you can organize for multiple
simulations. You can then save the signal data to a MAT-file for simulation or to map to
root-level ports. By default, Signal Editor creates signal data in
format. You can access the Signal Editor in the following ways:
signalEditorfunction — Signal Editor starts from the command line.
From the Root Inport Mapper — To create a MAT-file for your new signal data, select Signals > New MAT-File. To link in an existing signal data file from an existing scenario and edit the signals in that file, use the Signals > Edit MAT-File.
From the Signal Editor block
Signal Editor works only with MAT-files.
You can manipulate signals in these ways:
Create and edit multiple signals in multiple data sets. By default, Signal Editor creates
Use signal notations to create more complicated signals using MATLAB® expressions. You can use the Author and Insert dialog box or manually enter simple MATLAB expressions in the tabular area.
Use existing scenarios to get existing data sets for which you can edit and create signals.
Create and edit multidimensional signals.
Edit signals imported as registered custom file types. For more information, see Import Custom File Type.
While editing signal data:
Use tabular editing or MATLAB to modify signal data.
Use mouse or multi-touch editing to graphically modify signal data.
Modify signal properties such as name, interpolation, and unit properties.
Drag and drop signals to change signal hierarchies for buses and data sets.
Use signal notations and variables to replace signal data.
Alternatively, you can import data from external sources and edit them in Signal Editor. For more information, see Link in Signal Data from Signal Builder Block and Simulink Design Verifier Environment.
To graphically create and edit signal data, see Create Freehand Signal Data Using Mouse or Multi-Touch Gestures.
Differences Between the Root Inport Mapper Signal Editor and Other Signal Editors
Generally, the Signal Editor user interface is the same regardless of how you access it. Here are the differences in the Root Inport Mapper Signal Editor:
FILE section Save and Sync and SAVE commands save and synchronize to the Root Inport Mapper.
Insert section Scenario command always has the option, Scenario from Model.
If you start the function with a model name, the
function Signal Editor user interface shows the option Scenario from
Model in the Insert section.
Table Editing Data Support
The Signal Editor user interface supports all signal data types that Simulink® supports and that are editable.
Add and Edit Multidimensional Signals
To add multidimensional signals, use either of these options:
Change the Dimensions property in the Default Properties for Insertion dialog box, and then use Insert > Blank Signal to insert a new blank signal. For a multidimensional blank signal, enter a dimension greater than 1.
Enter multidimensional signal data in the Author and Insert dialog box Data parameter, such as
When you click the Plot/Edit check box for the signal, the tabular area displays the signal with columns for each dimension. You can edit the data individually in the tabular area, or click the replace button to replace the signal with a MATLAB expression. Use the Author and Replace Signal Data dialog box as though you are inserting a new expression with the Author and Insert dialog box. For more information, see Create Signals with MATLAB Expressions and Variables.
When replacing a signal, the signal dimension and complexity of the new signal must be the same as the signal being replaced.
For example, to create signal data with two columns and time from 1 to 10:
In the Signal Editor, select Insert > Author Signal.
Enter signal data with two columns and time from 1 to 10:
Click Insert Signal.
The hierarchy updates with the new signal data.
Expand the new signal and click the Plot/Edit check boxes for the new signal data. Observe the associated plots and the tabular data for the signal.
If the data does not plot as expected, use the Fit to window button in the Zoom & Pan section. For multidimensional signals, also make sure that you have the right plot selected for the column data you are editing.
You can edit the data directly in the table.
Or you can replace data completely with a new expression by clicking the Replace button and entering a new time range and data in the Author and Replace Signal Data dialog box.
Draw a Ramp Using Snap to Grid for Accuracy
This example describes how to create a ramp signal by selecting some points in the canvas.
In the Signal Editor tab, select Signal > Draw Signal.
To line up the signal data values along horizontal and vertical lines, select Snap X to Grid and Snap Y to Grid.
Move and zoom also honor snap to grid settings.
In the canvas, add three points:
Two points horizontal to each other
One point set to the right at an angle to the other signals
In the Signal Properties section, in Name, change the signal name to
Rampand press Enter.
To add the signal to the Signal Editor, in the Insert section, click .
To return to the main Signal Editor window and check that the signal has been added, click .
To observe the drawn signal data In Signal Editor, click the Plot/Edit check box for the
Rampsignal name in the hierarchy.
Save and Send Changes to the Root Inport Mapper Tool
When you are done adding and modifying signals and scenarios, use the Save and Sync button to save the changes to a MAT-file. The Signal Editor also sends the data to the Root Inport Mapper Tool:
If the Root Inport Mapper tool has the scenario loaded, the Root Inport Mapper tool updates with the new data.
If the Root Inport Mapper tool has the scenarios mapped and your changes affect the mapping, the Root Inport Mapper tool unmaps the scenario.
- Create Freehand Signal Data Using Mouse or Multi-Touch Gestures
- Map Root Inport Signal Data
- View and Inspect Signal Data
- Import Signal Data for Root Inport Mapping
- Exporting Signal Group Data
- Map Signal Data to Root Input Ports
- Root Inport Mapping Scenarios
- Create Signal Data for Root Inport Mapping
- Create Custom File Type for Import to Signal Editor