I believe that the following link should be able to provide you with further guidance regarding the query: https://www.mathworks.com/help/finance/portfolio-optimization-theory-mv.html
The videos at the bottom of the specified page can prove to be a powerful resource when beginning to learn more about Portfolio Optimization