MATLAB Answers

How to run fmincon using following function?

6 views (last 30 days)
Maxwell Barton
Maxwell Barton on 22 Jan 2020
Commented: Matt J on 22 Jan 2020
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 Comment

Matt J
Matt J on 22 Jan 2020
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.

Sign in to comment.

Accepted Answer

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

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Products


Release

R2018b