My issue seems simple but I can't find any method to work...
I've got a matrix with 4 columns and I want to extract the values from each
row to make a new 2x2 matrix for each row. ?From these resultant matrices, I
want to get the Eigen Values and output them from the function as usable
numbers (not a text string).
Here's the function...
###
Ef =
function(MAT) {for(i in c(1:(length(MAT)/4)))
return(matrix(c (eigen(matrix(c(MAT[i,]),ncol=2))$values),ncol=2))}
###
This function will return only the Eigen Values of the first row (MAT[1,])
of the matrix. ?However, if I replace "return" in the function with "cat",
the function will output all the desired values, but they will be as a text
string, which I can't use.
Furthermore, if I set a variable in the function, and then return the
variable at the end of the function, it yields the Eigen Values for the last
row of my matrix. ?That function looks like...
###
Ef=
function(MAT) {for(i in c(1:(length(MAT)/4)))
EV=(matrix(c (eigen(matrix(c(MAT[i,]),ncol=2))$values),ncol=2));
return(EV)}
###
From what I can tell, it seems that the function is working, however, I