setting up lsqlin constraints

I am trying to solve the equation y=m*x+c, with the constraints c>=A and m>=(c-A)*B.
I would also like to apply weights to y.
I have looked at using lsqlin but am unsure of how to setup the constraints.
Many thanks

回答 (1 件)

Matt J
Matt J 2018 年 10 月 25 日
編集済み: Matt J 2018 年 10 月 25 日

0 投票

lb=[-inf,A];
Aineq=[-1,+B]; bineq=A*B;
w=sqrt(weights(:));
mc=lsqlin(w.*x(:).^[1,0], w.*y, Aineq,Bineq,[],[],lb);
m=mc(1);
c=mc(2);

カテゴリ

質問済み:

2018 年 10 月 25 日

編集済み:

2018 年 10 月 25 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by