Skip to content

Commit 1afcfb7

Browse files
committed
implemented makeCacheMatrix body
1 parent 7f657dd commit 1afcfb7

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

cachematrix.R

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
## Put comments here that give an overall description of what your
22
## functions do
33

4-
## Write a short comment describing this function
4+
## create a matrix data structure as a list containing function to
5+
## set the value of the matrix
6+
## get the value of the matrix
7+
## set the value of the inverse of the matrix
8+
## get the value of the inverse of the matrix
59

610
makeCacheMatrix <- function(x = matrix()) {
7-
11+
inv.x <- NULL
12+
set <-function(y) {
13+
x<<-y
14+
inv.x <<-NULL
15+
}
16+
get <-function() x
17+
set.inv <- function(inv) inv.x <<- inv
18+
get.inv <- function() inv.x
19+
list(set=set,get=get,
20+
set.inv=set.inv,
21+
get.inv=get.inv)
822
}
923

1024

0 commit comments

Comments
 (0)