powered by
Creates a diagonal matrix from a vector
diagonal(d)
A diagonal matrix wirh the values of vector in the diagonal a zeros elsewhere
A numerical vector
Jose Luis Vicente Villardon
diag(c(1, 2, 3, 4, 5))
Run the code above in your browser using DataLab