I need to find the arithmetic mean of minimum elements from every column.
My algorithm goes like this:
Set the minimum to be the first element of the column, then compare this element to other column elements and find the minimum of one column. After that go to the next column an set the minimum to be the first element of the second column. Then find the minimum element of that column. Repeat this for the number of columns the matrix has. Every time I find the minimum of a column I add it to some variable for example number. And then number is the the sum of all minimums. After I only divide variable number with number of columns.
I am not near a computer so can someone review this algorithm and tell me if it is any good?