Here is a function: http://www.mathworks.com/matlabcentral/fileexchange/37804-generating-correlation-matrices-based-on-the-boundaries-of-their-coefficients/content/RandomCorr.m
But I don't know the meaning of K and p !?
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!