Main Content


Import signal data and properties from Signal Builder block to Signal Editor block



signal_editor = signalBuilderToSignalEditor(signal_builder,Name,Value) imports signal data and properties from Signal Builder block to the Signal Editor block. This function adds a Signal Editor block to the current model using the signal data and properties from the Signal Builder block. To contain the signal data and properties, the function creates a new MAT-file.

During the port, the signalBuilderToSignalEditor function:

  • Unicode® group names are prefixed with Test_Case_.

  • Group names are converted to valid MATLAB® variable names with leading and trailing white spaces removed.

  • Group names are converted with trailing underscores removed.

  • Remaining numbers maintained in the scenario name.

  • Orders signal groups alphabetically.

  • Creates unique group names from existing names following MATLAB conventions.

The signalBuilderToSignalEditor function does not support

  • Models that contain test case parameters. You can successfully port data from the Signal Builder block, but you cannot initialize parameters with the Signal Editor block in test harnesses generated by Simulink® Design Verifier™.

  • Models that contain Signal Builder signal generators created from the Create and Connect Generator context menu.

[signal_editor,sorted_group_index,sorted_group_names] = signalBuilderToSignalEditor(signal_builder,Name,Value) outputs vectors containing the signal groups and group names.


collapse all

This example shows how to replace an existing Signal Builder block with a Signal Editor block. To store signals from Signal Builder, the example uses RoadProfiles.mat.

model = 'ex_replace_signalbuilder';
sbBlockH = [model '/Road Profiles'];
seBlockH = signalBuilderToSignalEditor(sbBlockH,...

Input Arguments

collapse all

Signal Builder block to replace, specified as a scalar.

Data Types: char | string

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'FileName','RoadProfiles.mat'

MAT-file that stores signals and properties, specified as a scalar. 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.

Data Types: char | string

Replace Signal Builder block with Signal Editor block, specified as true or false.

Data Types: logical

Output Arguments

collapse all

Signal Editor block handle, specified as a scalar.

List of Signal Builder group indices, specified as a vector and ordered as they will appear in the Signal Editor.

Signal Editor group names, specified as a cell array of vectors, in alphabetical order.

The names are unique valid MATLAB variable names generated from the Signal Builder group names.



The Signal Editor block can output a bus for each signal, but cannot output all signals in a single bus. If the Signal Builder block from which you are importing signal data has a bus as output, consider:

  • Creating or using an existing Simulink.Bus bus object to contain the Signal Builder bus signals. The Simulink.Bus object contains the Simulink.BusElement that define each element in the Simulink.Bus object.

  • In the Signal Editor user interface, creating a bus element and dragging and dropping the signals imported from the Signal Builder block into that bus element.

  • After running the signalBuilderToSignalEditor function, select the Output a bus signal check box in the Signal Editor block and enter the Signal Builder bus object name in Select bus object text box.

Version History

Introduced in R2018a