Skip to content

Commit 0e92e52

Browse files
committed
expands the makeCacheMatrixand cacheSolve functions
1 parent dba0be7 commit 0e92e52

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

cachematrix.R

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
## Put comments here that give an overall description of what your
2-
## functions do
3-
4-
## Write a short comment describing this function
5-
###The first function, makeCacheMatrix creates a special "matrix"
6-
###which is really a list containing a function to
7-
###*set the value of the matrix
8-
###*get the value of the matrix
9-
###*set the value of the inverse
10-
###*get the value of the inverse
1+
#The first function, makeCacheMatrix creates a special
2+
#"matrix" which is really a list containing a function to
3+
#*set the value of the matrix
4+
#*get the value of the matrix
5+
#*set the value of the inverse
6+
#*get the value of the inverse
117

128
makeCacheMatrix <- function(x = matrix()) {
139
m <- NULL
@@ -24,14 +20,13 @@ makeCacheMatrix <- function(x = matrix()) {
2420
}
2521

2622

27-
## Write a short comment describing this function
28-
###The following function calculates the inverse of the
29-
###special "matrix" created with the above function.
30-
###However, it first checks to see if the inverse has
31-
###already been calculated. If so, it gets the inverse
32-
###from the cache and skips the computation.
33-
###Otherwise, it calculates the mean of the data and sets
34-
###the value of the inverse in the cache via the setinverse function.
23+
#The following function calculates the inverse of the
24+
#special "matrix" created with the above function.
25+
#However, it first checks to see if the inverse has
26+
#already been calculated. If so, it gets the inverse
27+
#from the cache and skips the computation.
28+
#Otherwise, it calculates the mean of the data and sets
29+
#the value of the inverse in the cache via the setinverse function.
3530

3631
cacheSolve <- function(x, ...) {
3732
## Return a matrix that is the inverse of 'x'

0 commit comments

Comments
 (0)