Main Content

Die Übersetzung dieser Seite ist veraltet. Klicken Sie hier, um die neueste Version auf Englisch zu sehen.

Numerische Typen

Ganzzahlen- und Gleitkommadaten

Numerische Klassen in MATLAB® umfassen vorzeichenbehaftete und vorzeichenlose Ganzzahlen sowie Gleitkommazahlen einfacher und doppelter Genauigkeit. Standardmäßig speichert MATLAB alle Zahlenvariablen als Gleitkommawerte mit doppelter Genauigkeit. (Sie können Standardtyp und Genauigkeit nicht ändern.) Sie können auswählen, jede Zahl oder jedes Zahlenarray als Ganzzahl oder als Wert einfacher Genauigkeit zu speichern. Ganzzahl- und Einfachgenauigkeit-Arrays bieten mehr effizienten Speicherplatz als doppelte Genauigkeit.

Alle numerischen Typen unterstützen grundlegende Array-Operationen, wie Indizieren, Umformen und mathematische Operationen.

Funktionen

alle erweitern

doubleArrays mit doppelter Genauigkeit
singleSingle-precision arrays
int88-bit signed integer arrays
int1616-bit signed integer arrays
int3232-bit signed integer arrays
int6464-bit signed integer arrays
uint8Arrays vorzeichenloser 8-Bit-Ganzzahlen
uint1616-bit unsigned integer arrays
uint3232-bit unsigned integer arrays
uint6464-bit unsigned integer arrays
castConvert variable to different data type
typecastConvert data type without changing underlying data
allfiniteDetermine if all array elements are finite (Seit R2022a)
anynanDetermine if any array element is NaN (Seit R2022a)
isintegerDetermine whether input is integer array
isfloatDetermine if input is floating-point array
isnumericDetermine whether input is numeric array
isrealDetermine whether array uses complex storage
isfiniteDetermine which array elements are finite
isinfDetermine which array elements are infinite
isnanBestimmen der Array-Elemente, die NaN sind
epsFloating-point relative accuracy
flintmaxLargest consecutive integer in floating-point format
InfCreate array of all Inf values
intmaxLargest value of specific integer type
intminSmallest value of specific integer type
NaNCreate array of all NaN values
realmaxLargest positive floating-point number
realminSmallest normalized floating-point number

Themen

  • Floating-Point Numbers

    MATLAB represents floating-point numbers in either double-precision or single-precision format. The default is double precision.

  • Single Precision Math

    This example shows how to perform arithmetic and linear algebra with single precision data.

  • Integers

    MATLAB supports 1-, 2-, 4-, and 8-byte storage for integer data. If you use the smallest integer type that accommodates your data, you can save memory and program execution time.

  • Integer Arithmetic

    This example shows how to perform arithmetic on integer data representing signals and images.

  • Create Complex Numbers

    Create complex numbers. Complex numbers consist of a real part and an imaginary part.

  • Infinity and NaN

    MATLAB represents infinity by the special value inf, and values that are neither real nor complex by the special value NaN, which stands for “Not a Number”.

  • Identifying Numeric Classes

    You can check the data type of a variable using any of these commands.

  • Display Format for Numeric Values

    Use the format function or set Preferences to control the display of numeric values.

  • Combining Unlike Integer Types

    If you combine different integer types in a matrix (e.g., signed with unsigned, or 8-bit integers with 16-bit integers), all elements of the resulting matrix are given the data type of the leftmost element.

  • Combining Integer and Noninteger Data

    If you combine integers with double, single, or logical classes, all elements of the resulting matrix are given the data type of the leftmost integer.

  • Empty Matrices

    If you construct a matrix using empty matrix elements, the empty matrices are ignored in the resulting matrix.

  • Concatenation Examples

    These examples show how to concatenate different data types.

  • Hexadecimal and Binary Values

    Specify hexadecimal and binary values either as literals or as text. Hexadecimal and binary literals are stored as integers. You can convert text representing hexadecimal and binary values to numbers, and numbers to text representations.