zeros

Matlab Functions List


  • X = zeros returns the scalar 0
  • X = zeros(n) returns an n-by-n matrix of zeros
  • X = zeros([sz1,...,szN]) returns an sz1-by-…-by- szN array of zeros
    • 方括号 [] 可省
  • X = zeros(___,typename) returns an array of zeros of data type typename
    • For example, zeros('int8') returns a scalar, 8-bit integer 0
  • X = zeros(___,'like',p) returns an array of zeros like p; that is, of the same data type (class), sparsity, and complexity (real or complex) as p
    • You can specify typename or 'like', but not both.