Hauptinhalt

Datentypen

Zuweisung spezifischer Datentypen zu Signalen und Blockparametern, Definition von Enumerationen

In Modellen bestimmen Datentypen die Interaktion zwischen Signalen und Blockparametern. Numerische Datentypen bestimmen, wie ein Computer Signale und Parameter speichert und wie ein Computer mathematische Operationen durchführt. Andere Simulink®-Datentypen bestimmen die Struktur oder die zulässigen Werte von Signalen und Parametern.

Um das mathematische Verhalten von Computerhardware zu simulieren oder effizienten Code aus einem Modell zu generieren, können Sie die numerischen Datentypen von Signalen und Parametern festlegen. Sie können Fließkomma-, Ganzzahl-, Festkomma- und andere numerische Typen angeben. Siehe Data Types Supported by Simulink.

Aufzählungs-Datentypen (Enumeration) beschränken Signale und Parameter auf die Verwendung der von Ihnen angegebenen Sätze von Werten. Sie können die Lesbarkeit des Modells verbessern, indem Sie jedem Aufzählungswert einen aussagekräftigen Namen geben. Weitere Informationen zur Benutzung von Aufzählungen in Simulink finden Sie unter Use Enumerated Data in Simulink Models.

Sie können Bustypen verwenden, um mehrere Signale oder Parameter zusammenzufassen, was die Lesbarkeit des Modells verbessern und die Modellpflege erleichtern kann. Siehe Define Bus Properties for Reuse.

Sie können Zeichenfolgentypen verwenden, um ganz einfach Zeichenfolgen in Modellen zu benutzen.

Blöcke

alle erweitern

Block Support TableView data type support for Simulink blocks
Data Type ConversionConvert input signal to specified data type
Data Type Conversion InheritedConvert from one data type to another using inherited data type and scaling
Data Type DuplicateForce all inputs to same data type
Data Type PropagationSet data type and scaling of propagated signal based on information from reference signals
Data Type Scaling StripRemove scaling and map to built in integer
ASCII to StringUint8 vector signal to string signal
Compose StringCompose output string signal based on specified format and input signals
Scan StringScan input string and convert to signals per specified format
String CompareCompare two input strings
String ConcatenateConcatenate input strings to form one output string
String ConstantOutput specified string
String ContainsDetermine if string contains, starts with, or ends with pattern
String CountCount occurrences of pattern in string
String FindReturn index of first occurrence of pattern string
String LengthOutput number of characters in input string
String to ASCIIConvert string signal to uint8 vector
String to DoubleConvert string signal to double signal
String to EnumInput string signal to enumerated signal
String to SingleConvert string signal to single signal
SubstringExtract substring from input string signal
To StringConvert input signal to string signal

Funktionen

alle erweitern

enumerationClass enumeration members and names
Simulink.defineIntEnumTypeDefine enumerated data type
Simulink.findIntEnumTypeFind enumeration classes defined by Simulink.defineIntEnumType
Simulink.clearIntEnumTypeDelete enumeration classes defined by Simulink.defineIntEnumType
Simulink.data.getEnumTypeInfoGet information about enumerated data type
Simulink.data.isSupportedEnumClassDetermine whether an enumeration class is valid for Simulink
Simulink.data.isSupportedEnumObjectDetermine whether an enumeration object is valid for Simulink
fixdtCreate Simulink.NumericType object describing a fixed-point or floating-point data type
fixptbestexpExponent that gives best precision for fixed-point representation of value
fixptbestprecDetermine maximum precision available for fixed-point representation of value
Simulink.importExternalCTypesGenerate Simulink representations of custom data types defined by C or C++ code
tunablevars2parameterobjectsCreate Simulink parameter objects from tunable parameters
stringtypeCreate string data type
showblockdatatypetableDisplay HTML page of Simulink block data type support
Simulink.Block.getInternalDataTypeGet data type of block parameter (Seit R2023a)

Klassen

Simulink.AliasTypeCreate alias for signal and parameter data type
Simulink.NumericTypeSpecify floating-point, boolean, or fixed-point data type
Simulink.IntEnumTypeAbstract class for defining enumerations

Modelleinstellungen

alle erweitern

Simulationbehavior for denormal numbersOption to emulate hardware handling of denormal numbers
Usealgorithms optimized for row-major array layoutEnable algorithm for row-major format code generation and simulation
Default for underspecified datatypeData type to use when Simulink cannot infer the data type
Use division for fixed-point net slopecomputationHow net slope computations are performed when a change of fixed-point slope is not a power of two
Gainparameters inherit a built-in integer type that is losslessParameter data type for Gain blocks that inherit via internal rule
Use floating-point multiplication tohandle net slope correctionsNet slope correction computation for floating-point to fixed-point casts
Inheritfloating-point output type smaller than single precisionInherited output data type behavior when block inputs are floating-point data types smaller than single precision
Application lifespan(days)Duration in days before timer overflow occurs
ClockresolutionSimulate target platform clock resolution (Seit R2023a)
Implement logic signals as Boolean data(vs. double)Logic signal data type

Signale

Underspecified datatypesDiagnostic action to take if the software is unable to infer signal data type
Wrap on overflowDiagnostic action to take if signal value overflows data type value range
Saturate on overflowDiagnostic action to take if signal value is too large for signal data type
Simulation rangecheckingDiagnostic action to take when signal value is outside its specified value range
Stringtruncation checkingDiagnostic action to take if string signal value is truncated

Parameter

Detect overflowDiagnostic action to take when fixed-point constant overflow occurs
Bitsof error thresholdSet a threshold of one bit, half bit, or zero bits for parameter overflow detection (Seit R2024a)
Detect precision lossDiagnostic action to take when fixed-point constant precision loss occurs
Suppress double to single detectionSuppress the double to single parameter precision loss detection (Seit R2024a)
Absolute difference thresholdReport parameter precision loss when the quantization error exceeds both absolute and relative difference thresholds (Seit R2024a)
Relative difference thresholdReport parameter precision loss when the quantization error exceeds both absolute and relative difference thresholds (Seit R2024a)
Detect underflowDiagnostic action to take when fixed-point constant underflow occurs
Detect downcastDiagnostic action to take when parameter downcast occurs during code generation

Themen

Verwandte Informationen

Enthaltene Beispiele