function mtm = mytrimmean(data, p)
sorteddata = sort(data(:));
n = length(sorteddata);
mtm = mean( sorteddata( max(1,ceil(p/2 * n)) :  min(n,ceil( (1-p/2)*n) )));
