Assuming that your coefficients are presented as row vectors, and that you might have multiple rows representing different locations being sampled:
objfun = @(x) sum(x,2);
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!