Table of Contents
String Concatenate
Concatenates a number of strings together.
Library
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
qc_open_library('quarc_library/Strings')Description
The String Concatenate block is similar to the
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
doc simulink/muxuint8
characters or a Simulink "string")
rather than numeric values. The size of the output is equal to the maximum length specified by the Maximum length
parameter. If this parameter is zero, then the dimension of the output string is the sum of the dimensions of the input strings.
Note that the maximum length includes the null terminator.
The String Concatenate block also supports variable-size input and output strings. To generate a variable-size output string, select the option for the Output dimensions mode parameter or allow the dimensions mode to be inherited from the input string. When the mode is inherited, the output will be a variable-size signal if any of the inputs are variable-size signals. Variable-size input strings are supported regardless of the state of the Output dimensions mode parameter. If the output is variable-size, then its width will be equal to the length of the string (including the null terminator). If that length exceeds the maximum length specified in the Maximum length parameter then it is truncated to the maximum length. Refer to Variable-Size Signals for more information on variable-size signals.
The number of strings to concatenate is specified via the Number of inputs parameter. The
String Concatenate block does not insert any characters, such as a space, between the strings. Each input string should
be a null-terminated vector of UTF-8 (or uint8
) characters or a Simulink "string".
Input Ports
...
The number of input ports depends on the Number of inputs parameter. Each input must be a
null-terminated vector of UTF-8 (uint8
) characters. Inputs may be variable-size signals.
It also accepts the Simulink "string" data type.
Output Ports
str
A string that is the concatenation of all the inputs. The data type of this output is uint8
(UTF-8 code unit), which is the
data type used by QUARC for strings. The string is guaranteed to be null-terminated. It will be a variable-size signal if the
Output dimensions mode is set to or is set to
and one or more of the input strings are variable-size signals.
Data Type Support
This block outputs the string as a null-terminated vector of UTF-8 characters or uint8
values. The input signals
may be any length. The inputs may also be variable-size signals or the Simulink "string" data type.. See
Variable-Size Signals for more information on variable-size signals.
Parameters and Dialog Box
Number of inputs
The number of strings to concatenate. This parameter determines the number of input ports of the block.
Maximum length
The maximum length of the output string in code units (bytes), including the null-terminator. The output will be a vector of this length. If this parameter is set to zero, then the maximum length is computed as the sum of the dimensions of the input signals.
Output dimensions mode
This parameter determines whether the str output is a fixed-size signal or a variable-size signal. The maximum size of the output string is determined by the Maximum length parameter regardless of the mode. However, for a variable-size output, the width of the output will vary dynamically with the size of concatenated strings. The default is to inherit the dimensions mode from the input strings so that a variable-size signal at one of the inputs will produce a variable-size signal at the output and otherwise the output is fixed-size. Refer to Variable-Size Signals for more information on variable-size signals.
Targets
Target Name |
Compatible* |
Model Referencing |
Comments |
---|---|---|---|
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
Last fully supported in QUARC 2018. |
|
Rapid Simulation (RSIM) Target |
Yes |
Yes |
|
S-Function Target |
No |
N/A |
Old technology. Use model referencing instead. |
Normal simulation |
Yes |
Yes |
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.