0% found this document useful (0 votes)
26 views1 page

Eg 5

This document defines a diagonal matrix A with entries 10, 12, 13, a scalar b equal to 10, and a vector p with entries 4, 5, 6. It then uses CVX to solve a convex optimization problem that minimizes the inner product of x and p, subjects x to the constraints that x'Ax is less than b, the sum of the entries of x is 1, and each entry of x is greater than or equal to 0.

Uploaded by

monicaedu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views1 page

Eg 5

This document defines a diagonal matrix A with entries 10, 12, 13, a scalar b equal to 10, and a vector p with entries 4, 5, 6. It then uses CVX to solve a convex optimization problem that minimizes the inner product of x and p, subjects x to the constraints that x'Ax is less than b, the sum of the entries of x is 1, and each entry of x is greater than or equal to 0.

Uploaded by

monicaedu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

A = diag([10,12,13]);

b = 10;
p = [4;5;6];
cvx_begin
variables x(3)
minimize (x'*p)
x'*A*x < b
sum(x) == 1
x >= 0
cvx_end

You might also like