uint64
64-bit unsigned integer arrays
Description
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.
Creation
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.
Syntax
Description
Input Arguments
Examples
Tips
When you create a numeric array of large integers (larger than
flintmax
), MATLAB initially represents the input as double precision by default. Precision can be lost when you convert this input to theuint64
data type. To maintain precision, calluint64
with each scalar element of the array instead. For example, see Convert Array of Large Integers Without Loss of Precision.If you have a text formatted in a character array or string scalar that contains large integers, then you can read this text and return an accurate 64-bit unsigned integer array by using the
sscanf
function. You can specify the format of the input fields so thatsscanf
directly converts the text that represents integers in decimals, octals, or hexadecimals without first converting them to Unicode code values. For comparison,uint64(X)
converts a character vector input to an integer array that represents the Unicode code values for each character.
Extended Capabilities
Version History
Introduced before R2006a