title: Matlab linprog maximization
body: <p>as part of a larger code i need to solve a linear program, I included the part written so far (with dummy numbers) below.
  However, I just started using Matlab (used R before that) and ran into the problem, that the linear optimization function linprog, only solves minimization problems. Mine is a maximization problem.</p>
  
  <p>Is there any way to have Matlab calculate a maximization problem (another function, or some obvious trick i am overlooking?)</p>
  
  <pre><code>% Clear and clc
  clear
  clc
  
  X = [  7   7   7
         5   9   7
         4   6   5
         5   9   8
         6   9   5];
  
  Y = [ 4   4
        7   7
        5   7
        6   2
        3   6];
  
  % Get number of DMUs (n), inputs (m) and outputs (s)
  [n, m] = size(X);
  s = size(Y,2);
  
  % Take logarithms of all values
  lnX = log(X);
  lnY = log(Y);
  
  %lower bounds for variables (Eta η, xi ξ, outputs,inputs)
  lb = [0 0 ones(1,(s+m))];
  
  %Equality constraints
  Aeq = [ones(n,1) -ones(n,1) lnY -lnX];
  beq = zeros(n,1);
  
  %options to surpress the "different algorithm" warning
  options = getDEAoptions(n);
  linprogoptions = options.optimopts;
  
  %Initialize weight matrix
  geometricDEAWeights = zeros(n,m+s);
  
  %DEA Optimization function
  for DMUvalue = 1:n
      f = [1 -1 lnY(DMUvalue,:) -lnX(DMUvalue,:)];
      [z, ~, exitflag, ~, dual] = linprog(f, [], [], Aeq, beq, lb, [],linprogoptions);
      geometricDEAWeights(DMUvalue,:) = z'; 
  end
  </code></pre>