This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

String to Enum

Input string signal to enumerated signal

  • Library:
  • Simulink / String

Description

The String To Enum block converts the input string signal to an enumerated signal. To use this block, create an enumeration class in the current folder and use that class name in the Output data type parameter.

Ports

Input

expand all

Input string signal, specified as a scalar.

Data Types: string

Output

expand all

Enumerated number associated with the input string, specified as a scalar.

Data Types: enumerated

Parameters

expand all

Use a data type object, for example, Simulink.IntEnumType.

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the data type attributes. See Specify Data Types Using Data Type Assistant for more information.

Use a data type object, for example, Simulink.IntEnumType.

  • Enumerated — Enumerated data class object.

  • <data type expression> — Expressions that evaluate to data types. Selecting Expression enables a second menu/text box to the right, where you can enter the expression.

Dependency

Clicking the Show data type assistant button enables this parameter.

Block Characteristics

Data Types

enumerated | string

Direct Feedthrough

yes

Multidimensional Signals

no

Variable-Size Signals

no

Zero-Crossing Detection

no

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Introduced in R2018a