File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change 5
5
# # Write a short comment describing this function
6
6
# makeCacheMatrix: This function creates a special "matrix" object that can cache its inverse.
7
7
8
- #
8
+ # makeVector <- function(x = numeric()) {
9
+ # m <- NULL
10
+ # set <- function(y) {
11
+ # x <<- y
12
+ # m <<- NULL
13
+ # }
14
+ # get <- function() x
15
+ # setmean <- function(mean) m <<- mean
16
+ # getmean <- function() m
17
+ # list(set = set, get = get,
18
+ # setmean = setmean,
19
+ # getmean = getmean)
20
+ # }
9
21
10
22
makeCacheMatrix <- function (x = matrix ()) {
11
-
23
+ m_cashe <- NULL
24
+ set <- function (new_val ) {
25
+ x <<- new_val
26
+ m_cashe <<- NULL
27
+ }
28
+ get <- function () x
29
+ set_inverse <- function (solve ) m_cashe <<- solve
30
+ get_inverse <- function () m_cashe
31
+ list (set = set , get = get ,
32
+ set_inverse = set_inverse ,
33
+ get_inverse = get_inverse )
12
34
}
13
35
14
36
You can’t perform that action at this time.
0 commit comments