I'm Using Win7 64x Rstudio Version 3.3.2.
The following functions is assignmet2 solution that other people submitted.
makeCacheMatrix <- function(x = matrix()) {
inv <- NULL
set <- function(y) {
x <<- y
inv <<- NULL
}
get <- function() x
setInverse <- function(inverse) inv <<- inverse
getInverse <- function() inv
list(set = set,
get = get,
setInverse = setInverse,
getInverse = getInverse)
}
First in the function makeCacheMatrix, why does 'set function' use variable 'y'?
Is it simply used to tell us how to use '<<-'?
Secondly, In 'get function', why is variable 'x' followed by the parentheses of the function? ( 'setInverse function - inv<<-inverse' , 'getInverse function - inv' are the same. )