Scan String
Scan input string and convert to signals per specified format
Libraries:
Simulink /
String
Description
The Scan String block scans an input string and converts it to signals
per the format specified by the Format parameter. The block
converts values to their decimal (base 10) representation and outputs the results as
numeric or string signals. Use this block when you want to deconstruct a string, for
example a sentence, into its individual components. For example, if the
Format parameter is set to "%s is %f."
, the
block outputs two parts, a string signal and a single signal. If the input is the string
"Pi is 3.14"
, the two outputs are "Pi"
and
"3.14"
.
Note
If you specify a numeric display format that is not large enough to display all the digits of a value, the displayed values may lose precision. The result depends on your computer hardware and operating system.
The Scan String, String to Double, and String to Single blocks are identical blocks. When configured for String to Double, the block converts the input string signal to a double numerical output. When configured for String to Single, the block converts the input string signal to a single numerical output.
For code generation, configure models that contain this block for non-finite number support by selecting the Configuration Parameters > Code Generation > Interface > Support non-finite numbers check box.
Ports
Input
Output
Parameters
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Algorithms
Extended Capabilities
Version History
Introduced in R2018a