Skip to content

sizeof

Storage size of the input in bytes.

n = sizeof(A)

Returns the number of bytes used to store A in memory. Useful for memory budgeting on large arrays.

sizeof(zeros(1000,1000)) % 8000000 (8 bytes per double × 1M elements)
sizeof(int32(0)) % 4
  • numel — Total number of elements.
  • size — Sizes along all dimensions, or along one specific dimension.