How to create diagonal and unequal matrix in R? -


i need create diagonal (6,6) matrix in r using valuse 1.2, 12.1, 6.5, 9.4, 4.9, 2.4. how should r code?

use diag:

diag(c(1.2, 12.1, 6.5, 9.4, 4.9, 2.4)) 

Comments

Popular posts from this blog

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

javascript - Handling constructor related functions while testing with mocha and sinon -