title: How to plot inequality equations associated with a linear programming function
body: <p>I'm fairly new to Matlab, but have some basic understanding of programming principles.</p>
  
  <p>I would like to plot the two variables, H (x-axis) vs. C (y-axis) following these two inequality equations: 4H+C&lt;=20 and H+3C&lt;=10, given: NB=H+2C (linear objective function vector), which are solved using the linprog function tool in Matlab (x=linprog(f,A,b);)</p>
  
  <p>I know how to input the linprog programming (note here negative values for f are because I want to maximize, and not minimize my objective function):</p>
  
  <pre><code>f=[-1,-2];
  A=[4 1; 1 3];
  b=[20;10];
  [x,fval,exitflag,output,lambda] = linprog(f,A,b);
  </code></pre>
  
  <p>which gives the optimal solution at x = (4.5455, 1.8182)</p>
  
  <p>I would like to show this graphically, i.e. plot both inequality equations on a graph with both axis scales going from 0 to 10 using intervals of 1, but I cannot seem to make this work.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>[H,C] = meshgrid((0:1:10),(0:1:10));
  figure, hold on
  xlabel('H, Hydropower')
  ylabel('C, Crops')
  </code></pre>
  
  <p>The first problem is that it plots from 0-1 using intervals of 0.1 (??)
  And of course, there are no lines representing the inequalities. But how to create the inequality lines? </p>
  
  <p>Any help would be very much appreciated!
  Urs</p>