How to run fmincon using following function?

1 次查看(过去 30 天)
Hi,
I am trying to minimise the following function to get as close to 0 as possible (i.e. x*B = c);
min(x) = x*B + c;
where x is a 200 x 1 column vector, B is a 1 x 200 row vector and c is a scalar constant. Is it possible to do this in matlab with fmincon or is another method better suited to the task?
  1 个评论
Matt J
Matt J 2020-1-22
x is a 200 x 1 column vector, B is a 1 x 200 row vector and c is a scalar constant
Are you sure you don't mean that x is 1 x 200 and B is 200x1 ? Otherwise, you have a system of 200 identical equations.

请先登录,再进行评论。

采纳的回答

Matt J
Matt J 2020-1-22
编辑:Matt J 2020-1-22
With no constraints, it would simply be,
x=ones(200)/(-c*B);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by