How to solve a system of equations with a constraint?
Show older comments
Hello, I'm new to MATLAB and I'm looking for a way to solve the system below:
w=lambda^(-1)*covmat^(-1)*(meanbl-(vec1'*covmat^(-1)*vec1)^(-1)*(vec1'*covmat^(-1)*meanbl-lambda)*vec1)
H=w'*meanbl+phi*sqrt(w'*covmat*w)
Where I want to find w (n-element vector) and phi (scalar). The constraint is that all the elements of w and also phi have to be positive. lambda and H are scalars, covmat is a nxn matrix, and meanbl and vec1 are n-element vectors.
I'm aware that fsolve does not allow for constraints, but I'm not being able to use lsqnonlin.
Thank you very much.
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!