Skip to content

Commit a512a5f

Browse files
Some bug fixes
1 parent 0852332 commit a512a5f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

cachematrix.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ makeCacheMatrix <- function(m = matrix()) {
1010
m <<- newmatrix
1111
cachedInverse <<- NULL
1212
}
13+
get <- function()
14+
{
15+
m
16+
}
1317
setinverse <- function(mi)
1418
{
1519
cachedInverse <<- mi
@@ -27,10 +31,10 @@ makeCacheMatrix <- function(m = matrix()) {
2731
## the above makeCacheMatrix. The data in m is assumed to be invertable
2832

2933
cacheSolve <- function(m, ...) {
30-
## Return a matrix that is the inverse of 'x'
31-
cachedInverse <- m$getInverse()
34+
## Return a matrix that is the inverse of 'm'
35+
cachedInverse <- m$getinverse()
3236

33-
if(!is.null(m))
37+
if(!is.null(cachedInverse))
3438
{
3539
message("getting cached inverse")
3640
return(cachedInverse)

0 commit comments

Comments
 (0)