% ressource allocation
K = 1000;
n = 500;
p = abs(randn(1,n));
r = abs(randn(K,1));
A = rand(K,n);
cvx_begin
    variable x(n,1) nonnegative
    maximize( p*x )
    A*x <= r
cvx_end
close all
plot(1:n,x,'o')
xlabel('Number of product')
ylabel('Quantity of product')
grid on
