Skip to content

Commit ce2e914

Browse files
committed
added comments
1 parent 11a9484 commit ce2e914

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

cachematrix.R

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +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
1+
## The function creates a special "vector", which is really a
2+
## list containing a function to:
3+
## - set the value of the matrix
4+
## - get the value of the matrix
5+
## - set the inverse of the matrix
6+
## - get the inverse of the matrix
57

68
makeCacheMatrix <- function(x = matrix()) {
79

@@ -19,7 +21,11 @@ makeCacheMatrix <- function(x = matrix()) {
1921
}
2022

2123

22-
## Write a short comment describing this function
24+
## The function calculates the inverse of the special "matrix"
25+
## created with the function "makeCacheMatrix".
26+
## It first checks to see if the inverse has already been calculated.
27+
## - If so, it gets the inverse from the cache
28+
## - Otherwise, it calculates the inverse and sets the inverse in the cache
2329

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

0 commit comments

Comments
 (0)