matlab function for 7 param histograms