ProgrammingAssignment2 icon indicating copy to clipboard operation
ProgrammingAssignment2 copied to clipboard

Programming Assignment 2: Lexical Scoping

Open syndesmosis opened this issue 5 years ago • 1 comments

In the first part create the function which can cache its inverse

makeCacheMatrix <- function(x = matrix()) { a <- NULL set <- function(y) { x <<- y a <<- NULL }

get <- function() x
setin <- function(inverse) a <<- inverse
getin <- function() a
list(set = set,
get = get,
setin = setin,
getin = getin)

}

This function create the inversion of this matrix. If the value doesn't exist, it will be calculate using the function. If the value already exists, value will be taken from cache:

cacheSolve <- function(x,...) { a <- x$getin() if (! is.null(a)) { message("The matrix inversion cache") return(a) } matrix <- x$get() a <- solve(matrix) x$setin(a) a }

syndesmosis avatar Mar 25 '20 10:03 syndesmosis

Assgnment looks good, nice job.

ShaneMag1 avatar Dec 26 '24 18:12 ShaneMag1