signalBuilderToSignalEditor

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

Description

example

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.

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.

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 uses RoadProfiles.mat.

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

Input Arguments

collapse all

Signal Builder block to replace, specified as a scalar.

Data Types: char | string

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

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.

.

Introduced in R2018a