Documentation

字符串Compare

Compare two input strings

  • 库:
  • Simulink / String

Description

字符串Comparecompares two strings. To see if two strings are identical, use this block. You can specify if the match is case sensitive and how much of the string to compare.

Ports

Input

expand all

First string to compare, specified as a scalar.

Data Types:string

Second string to compare, specified as a scalar.

Data Types:string

Output

expand all

True or false result, specified as a scalar:

  • 1— Match.

  • 0— No match.

Data Types:Boolean

Parameters

expand all

Case sensitivity for string comparison:

on

Consider string case when comparing strings.

off

Do not consider string case when comparing strings.

Amount of string to compare:

  • Entire string— Compare both entire strings.

  • First N characters— Compare the firstNcharacters of both strings.

Dependencies

Setting this parameter toFirst N charactersenables theNumber of charactersparameter.

Number of characters to compare

Dependencies

This parameter is enabled when theCompare Optionparameter is set toFirst N characters.

Data Types:double

Block Characteristics

Data Types

Boolean|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