From da5f5e28ba640bcd515ad20f3b776f0efcbbaee2 Mon Sep 17 00:00:00 2001 From: Revathi0612 Date: Mon, 7 Apr 2025 11:24:35 +0530 Subject: [PATCH] Create R Progam --- R Progam | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 R Progam diff --git a/R Progam b/R Progam new file mode 100644 index 00000000000..55476b60f62 --- /dev/null +++ b/R Progam @@ -0,0 +1,19 @@ +makeCacheMatrix <- function() { +mat <- NULL +inv_cache <- NULL +setMatrix <-function(x){ +mat <<-x +inv_cache<<- NULL +} +getInverse <- function() { +if (is.null(inv_cache)){ +inv_cache <<-solve(mat) +} +inv_cache +} +list(setMatrix=setMatrix,getInverse = getInverse) +} +cacheSolve <- function(x,...){ +inv_cache <-x$getInverse() +inv_cache +}