stringtype

Create string data type

Syntax

string = stringtype(maximum_length)
stringtype(maximum_length)

Description

example

string = stringtype(maximum_length) creates a Simulink® string data type with a maximum length. Alternatively, you can also create string data types using the String Constant, String Concatenate, and Compose String blocks.

stringtype(maximum_length) creates a Simulink string data type with a maximum length that you can type directly on the MATLAB® command line or in the Output data type parameter of the String Constant, String Concatenate, or Compose String block.

Examples

collapse all

Create a string data type of maximum length 10.

h=stringtype(10)
h = 

  StringType with properties:

    MaximumLength: 10
      Description: ''
        DataScope: 'Auto'
       HeaderFile: ''

Input Arguments

collapse all

Maximum length of string data type, specified as a scalar, from 1 to 32766. This value can be an integer, MATLAB variable, or MATLAB expression.

Data Types: double

Output Arguments

collapse all

String object, specified as a scalar.

Introduced in R2018a