Skip to content

Commit 4d74f28

Browse files
committed
update function
1 parent 4e8f5e9 commit 4d74f28

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cachematrix.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
## Create matrix obj that can cache the inverse
66
makeCacheMatrix <- function(x = matrix()) {
77
inverseMtx <- NULL
8-
set <- function(mtxx) {
9-
mtx <<- mtxx
8+
set <- function(x) {
9+
mtx <<- x
1010
inverseMtx <<- NULL
1111
}
1212
get <- function() mtx
@@ -21,13 +21,13 @@ makeCacheMatrix <- function(x = matrix()) {
2121
## Compute inverse and push to cache
2222
cacheSolve <- function(x, ...) {
2323
## Return a matrix that is the inverse of 'x'
24-
inv <- cMtx$getInverse()
24+
inv <- x$getInverse()
2525
if(!is.null(inv)) {
2626
message("getting cached matrix")
2727
return(inv)
2828
}
29-
dataMtx <- cMtx$get()
29+
dataMtx <- x$get()
3030
inv <- solve(dataMtx, ...)
31-
cMtx$setInverse(inv)
31+
x$setInverse(inv)
3232
inv
3333
}

0 commit comments

Comments
 (0)