# How to imply those Constrains?

Hello Everyone:

This object show as below is now I want to setting.

``````Bidder =3;
Item=5;
L=5;
B=Item*L;

for i=1:Bidder
for j=1:Item
Valuation(i,j)=randi(L);
end
end

for i=1:Bidder
Budget(i)=randi([L B]);
BudgetScaleDown(i)=ceil(Budget(i)*0.25);
N(i)=randi(5);
end

for i=1:Bidder
for j=1:Item
ValuationMHR(i,j)=min(Valuation(i,j),BudgetScaleDown(i));
end
end

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
%MHR
ghetero=zeros;
Ghetero=zeros;
Rhetero=zeros;
VirtualValuation=zeros;
A=1;
B=2;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
for i=1:Bidder
for j=1:Item
if ValuationMHR(i,j)<BudgetScaleDown(i)
ghetero(i,j)=wblpdf(ValuationMHR(i,j),A,B);
elseif ValuationMHR(i,j)==BudgetScaleDown(i)
ghetero(i,j)=sum(wblpdf(ValuationMHR(i,j):L,A,B));
else
ghetero(i,j)=0;
end
end
end
%Setting MHR
for i=1:Bidder
for j=1:Item
Rhetero(i,j)=A*B*ValuationMHR(i,j)^(B-1);
end
end

%Setting Virtual Valuation

for i=1:Bidder
for j=1:Item
VirtualValuation(i,j)=ValuationMHR(i,j)-(1./Rhetero(i,j)); %may come a problem
end
end

cvx_begin
variable X
Part=ghetero.*VirtualValuation;
maximize **sum(sum(sum((ghetero.*VirtualValuation).*X)))**
subject to
for i=1:Bidder
sum(sum(ghetero.*X))<=N(i)
end

for i=1:Bidder
sum((Part).'*X)<=B(i)
end

for j=1:Item
sum(sum(ghetero.*X))<=1
end

for i=1:Bidder
for j=1:Item
0 <= X(i,j)<=1
end
end

cvx_end
``````

Has some about in “Index exceeds matrix dimensions.”

``````Error in partII (line 82)
sum((Part).'*X)<=B(i)
``````

Is it a key to solve this situation?

Thanks !