Skip to content

nan

Array of not-a-numbers

nan

  • It returns not-a-number.

nan(n)

  • n should be non-negative integer.
  • It returns an n-by-n matrix containing all not-a-numbers.
  • 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 input argument.

nan(s1,s2,...,sn)

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

nan(sizeVec)

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