Skip to content

zeros

Array of all zeros

zeros

  • It returns 0.

zeros(n)

  • n should be non-negative integer.
  • It returns an n-by-n matrix containing all zeros.
  • If n is not positive, it returns an empty matrix.
  • If n is not integer, n would be rounded towards zero.
  • It does not accept ±nan, or ±inf as its argument.

zeros(s1,s2,...,sn)

  • s1, s2, ..., sn should be non-negative integers.
  • It returns an array of lengths s1, s2, ..., sn that contains all zeros.
  • If any of s1, s2, ..., sn is not positive, it returns an empty matrix.
  • Non-integer s1, s2, ..., sn would be rounded towards zero.

zeros(sizeVec)

  • It returns an array of size specified by the vector sizeVec. The array contains all zeros.
  • If any element of sizeVec is not positive, it returns an empty matrix. Non-integer element of sizeVec would be rounded towards zero.