We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d8303bc commit f154996Copy full SHA for f154996
1 file changed
cachematrix.R
@@ -35,12 +35,15 @@ makeCacheMatrix <- function(x = matrix()) {
35
## returns the inverse of the matrix, result is cached after the first run
36
cacheSolve <- function(x, ...) {
37
ci <- x$getinverse()
38
+
39
if (!is.null(ci)) {
40
message("returning inverse matrix from cache")
41
return(ci)
42
}
43
44
m <- x$get()
45
ci <- solve(m, ...)
46
x$setinverse(ci)
47
48
ci
49
0 commit comments