Skip to content

Commit eb10479

Browse files
committed
updated comments
1 parent 7f6194d commit eb10479

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cachematrix.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
## cacheSolve(cachedMatrix)
66

77

8-
## This function generates an Object that holds a matrix and it's
8+
## This function generates a cacheMatrix object that holds a matrix and it's
99
## possibily cached inverse. In order to calculate the inverse using caching
10-
## use the cacheSolve method.
10+
## use the cacheSolve function.
11+
## To construct a cachedMatrix, pass a matrix:
12+
## cachedMatrix <- makeCacheMatrix(matrix(1:4,2,2))
13+
1114
makeCacheMatrix <- function(x = matrix()) {
1215
inverse <- NULL
1316
set <- function(y) {
@@ -28,6 +31,8 @@ makeCacheMatrix <- function(x = matrix()) {
2831
## which was constructed my using the makeCacheMatrix function.
2932
## The First call calculates the inverse, every succeeding call
3033
## uses the cached inverse.
34+
## To calculate the inverse pass the cacheMatrix object:
35+
## cacheSolve(cachedMatrix)
3136

3237
cacheSolve <- function(x, ...) {
3338
i <- x$getinverse()

0 commit comments

Comments
 (0)