We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e8f5e9 commit 4d74f28Copy full SHA for 4d74f28
cachematrix.R
@@ -5,8 +5,8 @@
5
## Create matrix obj that can cache the inverse
6
makeCacheMatrix <- function(x = matrix()) {
7
inverseMtx <- NULL
8
- set <- function(mtxx) {
9
- mtx <<- mtxx
+ set <- function(x) {
+ mtx <<- x
10
inverseMtx <<- NULL
11
}
12
get <- function() mtx
@@ -21,13 +21,13 @@ makeCacheMatrix <- function(x = matrix()) {
21
## Compute inverse and push to cache
22
cacheSolve <- function(x, ...) {
23
## Return a matrix that is the inverse of 'x'
24
- inv <- cMtx$getInverse()
+ inv <- x$getInverse()
25
if(!is.null(inv)) {
26
message("getting cached matrix")
27
return(inv)
28
29
- dataMtx <- cMtx$get()
+ dataMtx <- x$get()
30
inv <- solve(dataMtx, ...)
31
- cMtx$setInverse(inv)
+ x$setInverse(inv)
32
inv
33
0 commit comments