Replace zeros with a number
이전 댓글 표시
I am trying to create an upper bound condition for a portfolio weighting problem to equal 2%. How can I replace the zeros in the following matrix to equal 0.02?
UB = zeros(N,1)
Thanks
답변 (1개)
madhan ravi
2019년 3월 28일
UB(UB==0) = 0.02;
% why not
UB = 0.02*ones(N,1) % in the first place?
카테고리
도움말 센터 및 File Exchange에서 Portfolio Optimization and Asset Allocation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!