strcmp
Compare strings
Description
compares strings tf
= strcmp(s1,s2
)s1
and s2
.
When using MATLAB® as the action language, strcmp
returns 1
(true)
if the two strings are identical. Otherwise,
strcmp
returns 0 (false)
.
When using C as the action language, strcmp
returns
0
if the two strings are identical. Otherwise,
strcmp
returns a nonzero integer where:
The sign of the output value depends on the lexicographic order of the input strings
s1
ands2
.The magnitude of the output value depends on the compiler that you use. This value can differ in simulation and generated code.
Strings are considered identical when they have the same size and content.
strcmp
is case sensitive.