For a given matrix A, how can i create a matrix B of the same size where every column is the mean (or any other function) of all the other columns?
example: a function on
A = [
1 1 1
2 3 4
4 5 6]
should result in
B = [
1 1 1
3.5 3 2.5
5.5 5 4.5]