powered by
ones(...) zeros(...)
eye
ones(3) ones(c(3, 3)) # same thing ones(3, 3) # same thing ones(size(matrix(NA, 3, 3))) # same thing zeros(3)
Run the code above in your browser using DataLab