help ones
ones Ones array.
ones(N) is an N-by-N matrix of ones.
ones(M,N) or ones([M,N]) is an M-by-N matrix of ones.
ones(M,N,P,...) or ones([M N P ...]) is an M-by-N-by-P-by-... array of
ones.
ones(SIZE(A)) is the same size as A and all ones.
ones with no arguments is the scalar 1.
ones(..., CLASSNAME) is an array of ones of class specified by the
string CLASSNAME.
这里 产生得是 N By N 全一 矩阵。
zeros(N)
生成 NxN的 零矩阵。
help zeros
zeros Zeros array.
zeros(N) is an N-by-N matrix of zeros.
zeros(M,N) or zeros([M,N]) is an M-by-N matrix of zeros.
zeros(M,N,P,...) or zeros([M N P ...]) is an M-by-N-by-P-by-... array of
zeros.
zeros(SIZE(A)) is the same size as A and all zeros.
zeros with no arguments is the scalar 0.
zeros(..., CLASSNAME) is an array of zeros of class specified by the
string CLASSNAME.
zeros(..., 'like', Y) is an array of zeros with the same data type, sparsity,
and complexity (real or complex) as the numeric variable Y.
Note: The size inputs M, N, and P... should be nonnegative integers.
Negative integers are treated as 0.
eye(N)
设置NxN单位矩阵。
eye Identity matrix.
eye(N) is the N-by-N identity matrix.
eye(M,N) or eye([M,N]) is an M-by-N matrix with 1's on
the diagonal and zeros elsewhere.
eye(SIZE(A)) is the same size as A.
eye with no arguments is the scalar 1.
eye(..., CLASSNAME) is a matrix with ones of class specified by
CLASSNAME on the diagonal and zeros elsewhere.
eye(..., 'like', Y) is an identity matrix with the same data type, sparsity,
and complexity (real or complex) as the numeric variable Y.
Note: The size inputs M and N should be nonnegative integers.
Negative integers are treated as 0.