Quoting shwaip
let's say your matrix is called A:
A(:,4) = (A(:,2) + A(:,3))/2
will put the avg in column 4
if your id's are always 1-based:
ind = find(A(:,4)==max(A(:,4)));
if not:
tmp = find(A(:,4)==max(A(:,4)));
ind = A(tmp,1);
Thanks again,I'm don't have matlab available right now so I can't try your code. Will this return the index or the actual value of col 1 for the corresponding max? If column 1 were just random id's would I get 6005 for the max value 42.5? What happens if two averages, col 4, were the same value?
1002 12 13 12.5
6005 42 43 42.5
3000 22 23 22.5
2454 32 33 32.5
Thanks
LD