https://au.mathworks.com/help/finance/portfolio.setdefaultconstraints.html
setDefaultConstraints - Set up portfolio constraints with nonnegative weights that sum to 1 - MATLAB
This MATLAB function sets up portfolio constraints with nonnegative weights that sum to 1 for Portfolio, PortfolioCVaR, or PortfolioMAD objects.