ldelgad8
29 Sep 2007, 12:32am
If I have a matix:
1 12 13
2 42 43
3 22 23
4 32 33
How would I take an average of cols 2 & 3 and put those values in a new column, 4? I can calc the averages but it creates a second matrix.
Desired result:
1 12 13 12.5
2 42 43 42.5
3 22 23 22.5
4 32 33 32.5
If I do a max on col 4 to determine the largest value, how would I also pull off the corresponding id no, id is col 1 (max=42.5 and id is 2)?
thanks
1 12 13
2 42 43
3 22 23
4 32 33
How would I take an average of cols 2 & 3 and put those values in a new column, 4? I can calc the averages but it creates a second matrix.
Desired result:
1 12 13 12.5
2 42 43 42.5
3 22 23 22.5
4 32 33 32.5
If I do a max on col 4 to determine the largest value, how would I also pull off the corresponding id no, id is col 1 (max=42.5 and id is 2)?
thanks