The use of strings is not recommended. MATLAB® Functions store strings as character arrays. The arrays cannot be re-sized to accommodate a string value of different length, due to lack of dynamic memory allocation. Strings are not a supported data type in Simulink®, so MATLAB Function blocks cannot pass the string data outside the block.
For example, the following code will produce an error:
name='rate_error'; %this creates a 1 x 10 character array name = 'x_rate_error'; %this causes an error because the array size is now 1 x 12, not 1 x 10.
If the string is being used for switch / case behavior, consider using enumerated data types
Verification and Validation
NASA Orion style guideline jh_0024: Strings
By Task > Modeling Standards for MAAB > MATLAB Functions > Check usage of character vector inside MATLAB Function block
For check details, see Check usage of character vector inside MATLAB Function block.