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
Add the same signals to multiple scenarios simultaneously.
Edit signal properties for multiple signals simultaneously.
Use signal notations to create more complicated signals using MATLAB® expressions. You can use the Author Signal 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:
Cut, copy, and paste data to and from Excel® spreadsheets.
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:
In the Properties for Insertion dialog box, on the Signals tab, change the Dimensions property. For a multidimensional blank signal, enter a dimension greater than 1. Then, select Insert > Signal to insert a new basic signal. Observe that the new signal has multiple dimensions represented.
Enter multidimensional signal data in the Author and Insert dialog box Data parameter, such as
When you double-click for the signal, the tabular data area displays the signal with columns for each dimension. You can edit the data individually in the tabular data area, cut, copy, or replace data with Excel spreadsheets, 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 double-click for the signal. Observe the associated plots and the tabular data for the signal.
If the data does not plot as expected, click Fit to view 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 Replace 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 > Signal.
In the Edit tab, to line up the signal data values along horizontal and vertical lines, select Align > Snap X to Grid and Align > Snap Y to Grid.
Move and zoom also honor snap to grid settings.
In the canvas, use Erase to erase the second point.
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.
Save and Send Changes to the Root Inport Mapper Tool
When you are done adding and modifying signals and scenarios, use the Save button to save the changes to a MAT-file. The Signal Editor can also send 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