I have to write a function that retrieves all of a given matrix's minors. I use a for loop to remove the required row and column, but each time iteration, it simply overwrites the previous minor. How can I maintain a copy of every minor? I currently have the following in the function: (Assume b is the matrix I've provided.)
minors - purpose (b, i, j)
I in 1: nrow(b) for
j in 1: ncol(b) for
{ a = b[-i,-j] \s } \s } \s a \s}
Minors = b = matrix(c(2,3,5,6,7,1,9,4,5), nrow = 3, ncol = 3) (b, i, j)
Any advise, recommendations, or assistance is highly welcomed.