clear;
clc;
format long;
b6=-200:10:200;
b5x=-100;
N=length(b6);
for i=1:N
      clc
      k=i
		C=[500; 250; 950; 1250; 250; -100; 750];
		f=C';
		A=[1 1 1 0 0 0 0;
   		0 0 0 1 1 0 0;
   		0 0 0 0 0 1 1;
   		-1 -1 -1 -1 -1 -1 -1;
   		-1 0 0 0 0 -1 0;
         0 0 0 0 0 0 1];
		B=[150 250 200 -500 b5x b6(i)];
		b=B';
		Aeq=zeros(1,7);
		beq=0;
		LB=zeros(7,1);
		UB=[150; 150; 150; 250; 250; 200; 200];
      [X,J(i),flag]=linprog(f,A,b,Aeq,beq,LB,UB);
      if flag<=0
         J(i)=0
      end
end
plot(b6,J), grid on
pause
Hasil=[b6' J']