VID1={};
VID2={};
Vehicle1={};
Vehicle2={};
ID=429x1
BEV=429x1 cell (every cell is a 525600x1 double)
Household=525600x20 double
x=3;
GUD={};
for i2=1:length(Hcombos(:,1))
C=Hcombos(i2,1);
C2=Hcombos(i2,2);
INCREASE2={};
HH2=Household(:, C)+Household(:, C2);
for j = 1:nBEV
if HHPerson(C)>=x
for k=1:nBEV
if k==j
Vehicle1{j,k}=BEV(:, j);
VID1{j,k}=ID(j);
else
Vehicle1{j,k}=BEV(:,k)+BEV(:,j);
VID1{j,k}=[ID(j) ID(k)];
end
end
end
if HHPerson(C2)>=x
for k2=1:nBEV
if k2==j
Vehicle2{j,k2}=BEV(:, j);
VID2{j,k2}=ID(j);
else
Vehicle2{j,k2}=BEV(:,k2)+BEV(:,j);
VID2{j,k2}=[ID(j) ID(k2)];
end
end
end
if HHPerson(C)<x
for k1=1:nBEV
if k1==j
Vehicle1{j,k1}=BEV(:, j);
VID1{j,k1}=ID(j);
else
Vehicle1{j,k1}=BEV(:,k1);
VID1{j,k1}=[ID(k1)];
end
end
end
if HHPerson(C2)<x
for k22=1:nBEV
if k22==j
Vehicle2{j,k22}=BEV(:, j);
VID2{j,k22}=ID(j);
else
Vehicle2{j,k22}=BEV(:,k22);
VID2{j,k22}=[ID(k22)];
end
end
end
end
for jj=1:numel(VID1)
V11=cell2mat(Vehicle1(jj));
ID1=cell2mat(VID1(jj));
for jj2=1:numel(VID2)
V22=cell2mat(Vehicle2(jj2));
ID2=cell2mat(VID2(jj2));
if numel(intersect(ID1,ID2))
continue
end
INCREASE2{jj,jj2}=max(HH2+V11+V22)./max(HH2);
end
end
GUD{i2}=INCREASE2;
end