Skip to content

True

Array of all logical 1 (true)

true

  • It returns logical 1.

true(n)

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

true(s1, s2, ..., sn)

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

true(sizeVec)

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