Source code can be downloaded from Matlab File Exchange: http://cn.mathworks.com/matlabcentral/fileexchange/52025-matmax