Skip to content

Commit 27dd396

Browse files
committed
Basic makeCacheMatrix
1 parent 7f657dd commit 27dd396

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

cachematrix.R

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,22 @@
44
## Write a short comment describing this function
55

66
makeCacheMatrix <- function(x = matrix()) {
7-
7+
i <- NULL
8+
9+
set <- function(y) {
10+
x <<- y
11+
i <<- NULL
12+
}
13+
14+
get <- function() x
15+
16+
setinverse <- function(solve) i <<- solve
17+
18+
getinverse <- function() i
19+
20+
list(set = set, get = get,
21+
setinverse = setinverse,
22+
getinverse = getinverse)
823
}
924

1025

0 commit comments

Comments
 (0)