inverse <- function(X) {
if (!is.matrix(X))
X <- matrix(X, nrow = sqrt(length(X)))
ss <- svd(X)
Xinv <- ss$u %*% diag(1/ss$d, nrow = nrow(X), ncol = nrow(X)) %*% t(ss$v)
return(Xinv)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.