Main Content

signalBuilderToSignalEditor

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

Description

signal_editor_or_subsystem = 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 or Subsystem block to the current model using the signal data and properties from the Signal Builder block. If the original Signal Builder has a virtual bus output port, the function adds a Subsystem block with a virtual output port.

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.

  • Optionally renames the resulting Signal Editor block to Signal Editor.

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_or_subsystem,sorted_group_index,sorted_group_names,signal_editor_if_virtual_bus] = signalBuilderToSignalEditor(signal_builder,Name,Value) outputs vectors containing the signal groups and group names.

example

Examples

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 creates RoadProfilesMine.mat.

model = 'ex_replace_signalbuilder';
open_system(model);
sbBlockH = [model '/Road Profiles'];
seBlockH = signalBuilderToSignalEditor(sbBlockH,...
'Replace',true,'FileName','RoadProfilesMine.mat');

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','RoadProfilesMine.mat'

MAT-file that signalBuilderToSignalEditor creates to store 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

Option to replace Signal Builder block with Signal Editor block, specified as false or true.

Data Types: logical

Option to update the Signal Builder block label with Signal Editor, specified as false or true. This argument replaces the Signal Builder block with Signal Editor block and changes the first instance of Signal Builder in the block label to Signal Editor. This argument is case-sensitive.

Data Types: logical

Output Arguments

collapse all

Handle of Signal Editor block or subsystem with virtual bus output, returned 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.

Handle of Signal Editor block in the new subsystem if the new subsystem has a virtual bus output, returned as a scalar.

Version History

Introduced in R2018a

expand all