[2x1^2+2x1x2+x2^2-10x1-10x2]
Show older comments
1. Use MATLAB Optimization Tool to solve the following problem: minimize [2x1^2+2x1x2+x2^2-10x1-10x2]
subject to [x1^2+x2^2≤500] and [5x1-x2 ≤ -4] .
2. Please hand-check all the Kuhn-Tucker conditions for your answer.
I tried to do it but it keeps giving me error message: Error: The expression to the left of the equals sign is not a valid target for an assignment. Error in bineq: Error: Unexpected MATLAB expression. Error in lb: Undefined function or variable 'L'.
Answers (1)
Guillaume
on 13 Dec 2015
0 votes
Assuming that 2x1^2+2x1x2+x2^2-10x1-10x2 actually means 2*x1^2 + 2*x1*x2 + x2^2 - 10*x1 - 10*x2, multiplication signs are not optional. Otherwise, I've no idea what your equation mean.
5 Comments
jiya quin
on 13 Dec 2015
Image Analyst
on 13 Dec 2015
If x does not mean a variable but instead means the x multiplication symbol, then things like "+x2^2" don't make sense. The multiplication symbol in MATLAB is *, not × like you might find in some papers or textbooks. If x1 and x2 are variables, then the equation Guillaume rewrote is the correct way of writing it in MATLAB and then I don't understand your comment at all.
jiya quin
on 13 Dec 2015
Walter Roberson
on 13 Dec 2015
That image is completely unreadable, not even close to being readable.
Guillaume
on 13 Dec 2015
@jiya, we're covering basic maths here. When you write
2a
It means,
2*a
The multiplication, *, is simply elided. The elision is not optional on a computer.
Categories
Find more on Function Creation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!