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 65de45b commit a2ddd75Copy full SHA for a2ddd75
cachematrix.R
@@ -19,6 +19,13 @@ makeCacheMatrix <- function(x = matrix()) {
19
# Intialize the cached value
20
m <- NULL
21
22
+ # A function to reset the data
23
+ # structure to a new matrix value
24
+ set <- function(y) {
25
+ x <<- y
26
+ m <<- NULL
27
+ }
28
+
29
# A function to get the given matrix
30
get <- function() x
31
@@ -30,7 +37,7 @@ makeCacheMatrix <- function(x = matrix()) {
37
38
# Return our data structure as a list, binding the
32
39
# above functions to it
33
- list(get = get,
40
+ list(set = set, get = get,
34
41
setinverse = setinverse,
35
42
getinverse = getinverse)
36
43
}
0 commit comments