Skip to content

Commit 23e0aed

Browse files
committed
notes
1 parent 8ff695c commit 23e0aed

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

assignment2.R

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,25 @@ cachemean <- function(x, ...) {
3434
x$setmean(m)
3535
m
3636
}
37+
38+
########
39+
# Matrix inversion is usually a costly computation and
40+
# their may be some benefit to caching the inverse of a matrix
41+
# rather than compute it repeatedly (there are also alternatives to matrix inversion that we will not discuss here).
42+
########
43+
44+
# makeCacheMatrix: This function creates a special "matrix" object that can cache its inverse.
45+
makeCacheMatrix <- function(){
46+
47+
}
48+
49+
50+
# cacheSolve: This function computes the inverse of the special "matrix" returned by makeCacheMatrix above.
51+
# If the inverse has already been calculated (and the matrix has not changed),
52+
# then the cachesolve should retrieve the inverse from the cache.
53+
cacheSolve <- function(){
54+
# Computing the inverse of a square matrix can be done with the solve function in R.
55+
# For example, if X is a square invertible matrix, then solve(X) returns its inverse.
56+
57+
58+
}

0 commit comments

Comments
 (0)