Skip to content

Commit db7ab09

Browse files
author
Stuart Woodward
committed
Bug fixes...
1 parent 425a856 commit db7ab09

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cachematrix.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ makeCacheMatrix <- function(x = matrix()) {
88
i <- NULL
99
set <- function(y) {
1010
x <<- y
11-
<<- NULL
11+
i <<- NULL
1212
}
1313
get <- function() x
1414
setinverse <- function(inverse) i <<- inverse
1515
getinverse <- function() i
1616
list(set = set, get = get,
1717
setinverse = setinverse,
18-
getinverse = getinverse)
18+
getinverse = getinverse
19+
)
1920

2021
}
2122

@@ -26,10 +27,10 @@ makeCacheMatrix <- function(x = matrix()) {
2627
cacheSolve <- function(x, ...) {
2728
## Return a matrix that is the inverse of 'x'
2829

29-
i <- x$getInverse()
30+
i <- x$getinverse()
3031
if(!is.null(i)) {
3132
message("getting cached data")
32-
return(m)
33+
return(i)
3334
}
3435
data <- x$get()
3536
i <- solve(data, ...)

0 commit comments

Comments
 (0)