Code covered by the BSD License

### Highlights from plot_feasible.m

5.0
5.0 | 1 rating Rate this file 20 Downloads (last 30 days) File Size: 16.2 KB File ID: #24816 Version: 1.0

# plot_feasible.m

### Matthew Roughan (view profile)

plot_feasible.m is a simple bit of code for visualizing 2D linear programming problems.

File Information
Description

plot_feasible(A, b, c, lower_b, upper_b, varargin)

Plots the feasible region of the 2D linear program
maximize f = c'*x
subject to A x <= b
on the region bounded by lower_b and upper_b.

It can plot the region, bounding lines, their intersection points and vertices of the feasible region along with the maximum. Its primary use (for me) is for students learning Linear Algebra.

Its has lots of options for making the plot look pretty, or annotating vertices, etc. And you can put iso-objective function lines across the plot to help. Multiple feasible region plots are also possible, to show overlaps.

Required Products Optimization Toolbox
MATLAB release MATLAB 7.4 (R2007a)
Tags for This File   Please login to tag files.
 Please login to add a comment or rating.
Comments and Ratings (2)
05 Jun 2015 Jamais avenir

### Jamais avenir (view profile)

Thanks for this code.
How can I obtain the feasible space of a Nonlinear constrained problem.
The problem I have is like this.
min F(X)
hk(X)=0 k=1,...,ne % equality constraints
gi(X)≤0 i=1,...,n % Inequality
constraints.
Ul<X<UB % UB and UL are pper and lowe bounds of X
where X=[x1,x2,...,xj]
I think that I should generate some random numbers first and then check the constraints, if generated point satisfies the constraint, so it is a feasible point. But I don't know how to check the constraint.
Thanks for your helps

05 Jun 2015 Jamais avenir

### Jamais avenir (view profile)

Thanks for this code.
How can I obtain the feasible space of a Nonlinear constrained problem.
The problem I have is like this.
min F(X)
hk(X)=0 k=1,...,ne % equality constraints
gi(X)≤0 i=1,...,n % Inequality
constraints.
Ul<X<UB % UB and UL are pper and lowe bounds of X
where X=[x1,x2,...,xj]
I think that I should generate some random numbers first and then check the constraints, if generated point satisfies the constraint, so it is a feasible point. But I don't know how to check the constraint.
Thanks for your helps

Comment only

Contact us