So I am currently using \'accumarray\' to find the averages of a range of numbers wich correspond to matching ID\'s. Ex Input:
ID----Value 1 215 1 33
What you are trying to compute is not a weighted mean, but rather a weighted histogram. There is a mex implementation of weighted histogram that can be found here. Though, accumarray is the safe way to go about.
accumarray