# Minimization of a function

38 ビュー (過去 30 日間)
Sultan 2018 年 12 月 26 日

I have only two matrices A=[1,2 4; 2, 3, 4; 1, 2,3] and B=[1,2 4; 1, 2,3] in my hands. I want to solve the following problem.
where ,
such that
,
.
Once it is computed, then I can use ''for loop'' for computing min for all rows of A and then max.
Thanks for sparing time.

#### 4 件のコメント

Sultan 2018 年 12 月 26 日
Rik Wisselink yes. Since people are confused about the question so I have reframed here.
I am still waiting for a solution.
Can anyone provide the program please?
Thanks!
Image Analyst 2018 年 12 月 26 日
What is allowed to change? Lambda1 and lambda2? Is there some clever method you have heard of? Of course we could do it numerically with a simple brute force iteration over all possible values of lambda1 and lambda2. Would that be good enough?
Walter Roberson 2018 年 12 月 26 日
We are not likely to give you complete code. If you show your code and your error message then we will help you debug.

サインイン to comment.

### 採用された回答

Matt J 2018 年 12 月 26 日
See lsqlin.

#### 0 件のコメント

サインイン to comment.

### その他の回答 (1 件)

Sultan 2019 年 1 月 15 日

Is it correct code for the above problem? In place of λ, I have used x.
A = [1 2 4; 2 3 4; 1 2 3]; B = [1 2 4; 1 2 3]
%Given: A; B;
n = length(B);
C = B';
D = ones(1,n);
for i = 1:length(A)
cvx_begin
variable x(n)
minimize( norm(A(i,:)' - C*x, 2))
subject to
D * x == 1
0 <= x <= 1
cvx_end
optimalValue(i) = cvx_optval^2;
X(:,i) = x;
end
maximumValue = max(optimalValue);
We can also use lsqlin. Thanks everyone for helping me.

#### 0 件のコメント

サインイン to comment.

サインイン してこの質問に回答します。

Translated by