It will give you the index number of the matrix with the max determinant. I suggest you look into the LOC() function as it has many uses. Either look in the documentation or read Rick's excellent blog, he has written about LOC several times: Beware the naked LOC - The DO Loop LOC: The most useful function you’ve never heard of - The DO Loop I suggest you replace the old definition of i, with: d = det(a) || det(b) || det(c); i = loc( d = max(d)); Note there is no nakedness here as the vector of three determinants (d) must have at least one element equal to the maximum. You now need to think about handling ties. Most of the time 'i' will be a 1x1 matrix containing the number 1,2 or 3 of the matrix a,b or c with the max determinant. But it might be a 1x2 or a 1x3 matrix of index numbers if there are ties. You need to add code to handle these different conditions, perhaps print a warning message about the number of ties.
... View more