I am trying to solve a problem using linear optimization on matlab
sum=zeros(5,1);
for i=1:5
min 2x1+3x2-5x3
s.t.
x1 <= 4;
x2+3x3 <= 2;
sum(1:i) >= 3
sol=linprog(fill them)
sum(i) = sum(i)+sol(2)-sol(3)
end
How can I represent sum(i) in the matrices we use in linprog function?