assert(0 == mean_matrix(@(x) x, jacobi_parameter, 1));
assert(0 == mean_matrix(@(x) x, jacobi_parameter, 2));
assert(0 == mean_matrix(@(x) x, jacobi_parameter, 3));
assert(abs(mean_matrix(@(x) x, jacobi_parameter, 7))<10*eps(1));

k = 5;
f = @(x) x.^2+1:k;
assert(0 == mean_matrix(f, jacobi_parameter, 1));

