フィルターのクリア

Ax=b question

2 ビュー (過去 30 日間)
Vince Smith
Vince Smith 2019 年 4 月 22 日
編集済み: Matt J 2019 年 4 月 22 日
Consider the matrix equation, Ax=b. Suppose I want to manipulate one of the values of b by increasing it in multiples of 100 until the maximum value within the x matrix exceeds 50000. What sort of code would I write to determine the size of the manipulated b value and which value of x exceeds 50000?

採用された回答

Matt J
Matt J 2019 年 4 月 22 日
編集済み: Matt J 2019 年 4 月 22 日
You could use intlinprog. Assuming WNLOG that the manipulated b value is b(1),
N=numel(b);
f=[-1,zeros(1,N)].';
Aeq=[+100*f(1:N),A];
beq=[0;b(2:N)];
lb=[0;inf(N,1)];
ub=[inf;50000*ones(N,1)];
solution = intlinprog(f,1,[],[],Aeq,beq,lb,ub);
b_manipulated=100*solution(1)+100;
x=A\[b_manipulated;b(2:N)];
find(x>50000)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by