Skip to content

completed function #5784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update cachematrix.R
updated script. Naming correction (m to inv)
  • Loading branch information
dalawad authored Apr 9, 2025
commit d90d8c79439cf7f4cd065aa725a3cce22c7cd566
4 changes: 2 additions & 2 deletions cachematrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ makeCacheMatrix <- function(x = matrix()) { # The function where data is stored
inv <- NULL
set <- function(y) {
x <<- y
m <<- NULL
inv <<- NULL
}
get <- function() x
setinv <- function(inverse) inv <<- inverse
Expand All @@ -23,7 +23,7 @@ makeCacheMatrix <- function(x = matrix()) { # The function where data is stored
cacheSolve <- function(x, ...) { # A function that solves the inverse of a matrix 'x', the inverse is stored in makeCasheMatrix for fast retrival
inv <- x$getinv()
if(!is.null(inv)) {
message("getting cached data")
message("getting cached inverse")
return(inv)
}
data <- x$get()
Expand Down