The statistics toolbox does have a private function that implements AS 190 and 190.2 under toolbox/stats/private/stdrinv.m from R2011a. It is called from the multcompare tool when doing the default Tukey HSD comparison.
The note accompanying the code is
% Based on Fortran program from statlib, http://lib.stat.cmu.edu
% Algorithm AS 190 Appl. Statist. (1983) Vol.32, No. 2
% Incorporates corrections from Appl. Statist. (1985) Vol.34 (1)
For people getting different results on each run, this is due to the use of psuedorandom number generators in initialization. Try setting the psuedorandom number seed:
18 Oct 2011
Counts the number elements in a specified vector that match a specified criteria.
Author: Richard Medlock
For me histc(x,unique(x)) did what I wanted. This gives me the frequency of each value that occurs in the vector x.