powered by
diagv(v, M)
N
diag
v <- 1:1000 M <- matrix(runif(3000), 1000, 3) dim(diagv(v, M))
Run the code above in your browser using DataLab