https://it.mathworks.com/help/finance/portrand.html
portrand - Randomized portfolio risks, returns, and weights - MATLAB
This MATLAB function returns the risks, rates of return, and weights of random portfolio configurations.
portfolio risksrandomizedreturnsweightsmatlab