In R I have a function that creates a 10x10 matrix. If we run this function n times, what would be an easy way to calculate the average of each element in this matrix? Below is what i'm working with so far.
for (i in 1:10) {
Gs[,i] <- G(N, s[i], m[i] , y[i], x[, i])
}
return(Gs)
I want the mean for every position in the matrix of n values from the function calls.