This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


64-bit unsigned integer arrays


Variables in MATLAB® of data type (class) uint64 are stored as 8-byte (64-bit) unsigned integers. For example:

y = uint64(10);
whos y
  Name      Size            Bytes  Class     Attributes

  y         1x1                 8  uint64                        

For more information on integer types, see Integers.


Some array creation functions allow you to specify the data type. For instance, zeros(100,'uint64') creates a 100-by-100 matrix of zeros of type uint64.

If you have an array of a different type, such as double or single, then you can convert that array to an array of type uint64 by using the uint64 function.


Y = uint64(X)



Y = uint64(X) converts the values in X to type uint64. Values outside the range [0,264-1] map to the nearest endpoint.

Input Arguments

expand all

Input array, specified as a scalar, vector, matrix, or multidimensional array.

Data Types: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | logical | char


collapse all

Convert a double-precision variable to a 64-bit unsigned integer.

x = 100;
xtype = class(x)
xtype = 
y = uint64(x)
y = uint64

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced before R2006a