powered by
eye(n, m = n) ones(n, m = n) zeros(n, m = n)
n x m
m
No dropping of dimensions; if n = 1, still returns a matrix and not a vector.
n = 1
Diag
eye(3) ones(3, 1) zeros(1, 3)
Run the code above in your browser using DataLab