Main Content

Signal Editor

Create and edit input signals

Description

The Signal Editor lets you create and edit input signals that you can organize for multiple simulations.

Signal Editor default

Open the Signal Editor

  • MATLAB® Command Window: Enter signalEditor.

  • 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.

  • Signal Editor block: Click Start Signal Editor icon.

  • Simulink® Editor toolstrip:

    1. In the Prepare section of the Simulation tab, click the expander.

    2. Click Inputs & Parameter Tuning > Signal Editor.

Examples

expand all

You can use these keyboard shortcuts to interact with the Signal Editor.

This table shows edit actions:

ActionKeyboardMouseMulti-Touch

Insert point

Ctrl+P

Click Insert point icon

Tap

Insert line

Ctrl+L

Click Insert line icon

Pan and pinch

Draw

Ctrl+D

Click and draw

Pan

Select a point

Ctrl+T

Click Select point icon, then click and select point or area

To select all areas, double-click

Pan and pinch

To select all areas, double-tap

Move a point

Ctrl+M

Click Move point icon and drag

Tap and move

Change data of a point 

Click Change data of point icon

 
Continuously delete points on a line 

Click Eraser icon

 
Fit to view if zoom action is selected 

Three mouse clicks

Triple tap

Zoom out if zoom action is selected 

Two mouse clicks

Double tap

Expand along the x-axis 

Ctrl+mouse pan

Pry x-axis

Expand along the y-axis 

Shift+mouse pan

Pry y-axis

This table shows zoom actions:

Type of Zoom or PanAction

Zoom in along the T and Y axes.

Click

Zoom in along the time axis. After selecting the icon, on the graph, drag the mouse to select an area to enlarge.

Click

Zoom in along the data value axis. After selecting the icon, on the graph, drag the mouse to select an area to enlarge.

Click

Zoom only in x while zooming in xy.

Zoom in xy while pressing Ctrl

Zoom only in y while zooming in xy.

Zoom in xy while pressing Shift

Zoom out from the graph.

Click

Fit the plot to the graph. After selecting the icon, click the graph to enlarge the plot to fill the graph.

Click

Pan the graph up, down, left, or right. Select the icon. On the graph, hold the left mouse button and move the mouse to the area of the graph that you want to view.

Click

You can use these alignment commands to snap to the plot grid for accuracy.

Alignment actions:

ActionSnap to Grid

Snap values to x grid lines for point and line insertion and movement and zooming.

Snap X to Grid

Snap values to y grid lines for point and line insertion and movement and zooming.

Snap Y to Grid

Snap values to x minor grid lines for point and line insertion and movement and zooming.

Snap X to Tick

Snap values to y grid lines for point and line insertion and movement and zooming.

Snap Y to Tick

Snap to incremental value in X grid.

Snap X to Increment

Snap to incremental value in Y grid.

Snap Y to Increment

Turn plot markers on and off.

Markers

In the Scenarios and Signals section, you can change signal names and hierarchy order, create duplicates of signals, and delete signals. Simulink ignores leading and trailing spaces in signal names.

To change a signal name, double-click the name and enter a new name.

To change the unit or interpolation of a signal, click the plus sign, then select the Unit or Interpolation check boxes.

To change the order of a signal in the hierarchy, drag and release the signal. For example, you can drag and release signals into a bus.

Alternatively, in the Adjust section, use the Move Up and Move Down buttons.

To copy a signal and paste it under the original, right-click the signal and select Duplicate Signal.

Alternatively, in the Adjust section, use the Duplicate button. You can also adjust the default properties of the signal you duplicate. For more information, see Create Signals with the Same Properties.

To copy a signal and paste it elsewhere in hierarchy, select Copy and then Paste.

To create signals of the same predefined type, in the Adjust section, use the Duplicate button. To change the predefined signal type, click the Defaults icon, . A Default Properties for Insertion dialog box opens.

On the Signals tab:

  • Data type — From the drop-down list, select the signal data type.

    Enumeration — When you select the Enum data type, this parameter displays. Enter the class name of your enumeration.

    If you define an enumeration class that contains the same integer value multiple times, the Signal Editor treats the first enumeration value as the canonical value and equates all subsequent instances of the same underlying integer to the enumerated name. In this example, Red(118)) is canonical, so Pink equals Red.

    classdef(Enumeration) hEnumColors_duplicateValues < Simulink.IntEnumType
      enumeration
        Red(118)
        Yellow(-14)
        Blue(90)
        Green(87)
        White(-14)
        Black(198)
        Brown(90)
        Pink(118)
        Purple(90)
      end
      methods (Static = true)
        function retVal = getDefaultValue()
          retVal = hEnumColors_duplicateValues.Blue;
        end
      end
    end
    
  • Interpolation — From the drop-down list, select linear or zero order hold.

  • Unit — Enter an appropriate unit expression. For a suggested list of unit expressions, see Allowed Units.

  • Dimensions — Enter the number of dimensions for the signal.

  • Signal type — From the list, select real or complex.

  • Variable type — From the list, select Timeseries (default), Timetable, Logged timeseries, or Logged timetable.

    Logged timeseries and logged timetables objects are Simulink.SimulationData.Signal objects whose Value property is of data type timeseries or timetable.

On the Buses tab:

  • Bus object — From the list, select the bus object for which to define the dimensions. If you leave the Bus object parameter at the default <object name>, the Signal Editor adds empty buses.

  • Dimensions — Enter the number of dimensions for the bus object.

On the Constant tab:

  • Value — Enter constant value to output.

  • Time — Enter sample time.

On the Step tab:

  • Initial value — Enter output value before step.

  • Final value — Enter output value after step.

  • Start time — Enter time when step starts.

  • Step time — Enter time increment when step occurs.

  • Step final time — Enter final step time.

On the Pulse tab:

  • Initial value — Enter initial default value of signal.

  • Value at trigger — Enter value of signal at pulse trigger.

  • Pulse duration — Enter length of time of pulse.

  • Step time — Enter time when step occurs.

  • Trigger time — Enter time when pulse trigger occurs.

This example describes how to add and delete data to the signals in the linked scenario. To create a model and data to work with, see Add Signals to Scenarios.

In the Signal Editor, in the Scenarios and Signals section, click the plot check box for the signal ts.

Add data to the signal ts.

  1. Click the add row icon and add signals. To add a signal row between other signals, click the signal above and click the add row icon.

  2. When done, click Apply to update the plot.

Remove the time 20 line from the signal. Select 20 and click .

Alternatively, if you want to replace all the signal data for ts with a signal defined with signal notations, click the replace button and use the Author and Replace Signal Data dialog box to define new data.

Related Examples

Parameters

expand all

File

Open a new Signal Editor session.

Open MAT-file containing signals to be displayed and edited in Signal Editor.

Save the contents of Signal Editor.

Insert

Create scenario to contain signals.

Change the predefined signal type and properties by clicking .

Insert basic signal by clicking Insert basic signal icon.. For more information, see Work with Basic Signal Data.

Insert function-call signal by clicking Insert function-call signal icon..

If you need a function-call signal for a root inport with explicit periodic sample time, insert a ground signal instead. Simulink then executes the function-call automatically.

Insert constant signal with value of 1 by clicking Insert constant signal icon..

Insert bus by clicking Insert bus signal icon.. To the bus you can add signals using any of the other signal insertions techniques.

Author signal using MATLAB expressions or workspace variables by clicking . The dialog box displays:

  • Time — Enter the range of time for the data.

  • Data — Enter the MATLAB expression for the signal.

  • Data type — Select or enter the signal data type.

    • double

    • single

    • int8

    • uint8

    • int16

    • uin16

    • int32

    • uint32

    • boolean

    • fixdt(1,16)

    • fixdt(1,16,0)

    • fixdt(1,16,2^0,0)

    • string

    • Enum: <class name>

    If you enter your time and data and then select a fixed-point data type, the Signal Editor displays a fixed-point proposed data type for your data.

    • To help you select a fixed-point data type, click the Show Histogram button (). Clicking this button displays a plot of the signal data using the selected fixed-point data type. The graph displays:

      ColumnInformation
      ValuesThe negative, positive, and zero signal values.
      Potential OverflowsBins the signal values that may overflow.
      In-RangeBins the signal values that are within acceptable range.
      Potential UnderflowsBins the signal values that may underflow.

      To see the difference that a data type may have on the histogram, select:

      • User Specified

      • Binary Scaling

      • Slope & Bias Scaling

      For more information, see Histogram Plot of Signal (Fixed-Point Designer).

    • To apply the proposed fixed-point data type to your data, click the Use proposed data type button ().

For more information, see Create Signals with MATLAB Expressions and Variables.

Insert step waveform signal with an initial value of 0 and a final value of 1 by clicking Insert step waveform signal icon..

Insert ground signal by clicking Insert ground signal icon..

Insert graphically-generated signal by clicking Insert graphical signal icon..

Insert pulse signal waveform signal with an initial value of 0, trigger value of 1, and initial pulse duration of 1 by clicking Insert pulse waveform signal icon..

Adjust

Copy signal and paste it under original signal.

Move signal up the signal hierarchy in a bus or scenario by clicking the signal and then clicking Move Up.

Move signal down the signal hierarchy in a bus or scenario by clicking the signal and then clicking Move Down.

Delete signal by selecting one or more signals and clicking Delete signal icon..

Programmatic Use

expand all

signalEditor opens the Signal Editor from the MATLAB Command Window.

Version History

Introduced in R2017b

See Also

Blocks

Functions

Tools