title: Caching inverse of a matrix in R
body: <p>I am a beginner in R and I was doing a programming assignment from Coursera. The question involves caching of Inverse of matrix in R. I know it has been been asked many times but I am still not able to understand those solutions. Can someone dry run it from step 1 with an input and explain each and every step for better understanding? It would be highly appreciated.Basically I am more confused with the set functions and it's parameters. what would be value of y?</p>
  
  <pre><code>makeCacheMatrix &lt;- function(x = matrix()) {
    j &lt;- NULL
    set &lt;- function(y){
      x &lt;&lt;- y
      j &lt;&lt;- NULL
    }
    get &lt;- function()x
    setInverse &lt;- function(inverse) j &lt;&lt;- inverse
    getInverse &lt;- function() j 
    list(set = set, get = get, 
         setInverse = setInverse, 
         getInverse = getInverse)
  
  }
  
  
  ## Write a short comment describing this function
  
  cacheSolve &lt;- function(x, ...) {
          ## Return a matrix that is the inverse of 'x'
    j &lt;- x$getInverse()
    if(!is.null(j)){
      message("getting cached data")
      return(j)
    }
    mat &lt;- x$get()
    j &lt;- solve(mat,...)
    x$setInverse(j)
    j
  }
  </code></pre>