function linprog_test num_iters = 25; min_size = 2; size_inc = 6; num_sizes = 100; size_array = zeros(num_sizes,1); ave_simp_time = zeros(num_sizes,1); ave_int_pt_time = zeros(num_sizes,1); for j = 1 : num_sizes num_unks = min_size + size_inc * (j - 1); for iters = 1 : num_iters lptime = 0; c = []; A = []; b = []; Aeq = []; beq = []; lb = []; ub = []; x0 = []; options = optimset('LargeScale', 'on', 'Simplex', 'off'); tt = cputime; [x,fval,exitflag,output,lambda] = linprog(c,A,b,Aeq,beq,lb,ub,x0,options); lptime = lptime + cputime - tt; end ave_int_pt_time(j) = lptime / num_iters; size_array(j) = min_size + size_inc * (j - 1); for iters = 1 : num_iters lptime = 0; c = []; A = []; b = []; Aeq = []; beq = []; lb = []; ub = []; x0 = []; options = optimset('LargeScale', 'off', 'Simplex', 'on'); tt = cputime; [x,fval,exitflag,output,lambda] = linprog(c,A,b,Aeq,beq,lb,ub,x0,options); lptime = lptime + cputime - tt; end ave_simp_time(j) = lptime / num_iters; end figure; int_pt_coeffs = polyfit(size_array, ave_int_pt_time, 2); simp_coeffs = polyfit(size_array, ave_simp_time, 1); int_pt_model = polyval(int_pt_coeffs, size_array); simp_model = polyval(simp_coeffs, size_array); plot(size_array, ave_simp_time, 'r', size_array, simp_model, '--r',... size_array, ave_int_pt_time, 'b', size_array, int_pt_model, '--b'); legend('Simplex Data','Simplex Model','Interior Point Data','Interior Point Model');