Code covered by the BSD License  

Highlights from
Plot 2D/3D region

4.57143

4.6 | 14 ratings Rate this file 52 Downloads (last 30 days) File Size: 10.93 KB File ID: #9261
image thumbnail

Plot 2D/3D region

by Per Bergström

 

05 Dec 2005 (Updated 04 Jan 2010)

The program plots convex closed regions in 2D/3D.

Editor's Notes:

This file was highlighted in the File Exchange Pick of the Week blog.

| Watch this File

File Information
Description

The program plots convex closed regions in 2D/3D. The region is a subset of R2 or R3 such that Ax>=b and lb<=x<=ub. It is also possible to plot points in the same plot.

(See help plotregion for more documentation)

MATLAB release MATLAB 6.0 (R12)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (14)
06 Dec 2005 John D'Errico

Splendid. A very nice utility that I'll happily use. I'd have
liked more documentation in the help, but I tend to go
overboard there myself, so my standards may be deemed
excessive by sane, rational beings. The examples were
enough to figure it out.

15 Feb 2006 Peter Larsen

Just what I needed. Thanks.

26 Sep 2006 Amir Ali Ahmadi

After hours of playing around with different m-files, trying to figure out how to fill the region b/w the intersection of some planes in R^3, I found this m-file which took care of the job in less than a minute.

Matlab has a built-in function ?area? for 2-D but nothing for 3-D (to my understanding).

I used plotregion.m to visualize a subset of R^3 where all the vectors have norm-1 less than say 3. (i.e. abs(x)+abs(y)+abs(z)<=3). This is easily done using this m-file by inputting an 8x3 constraint matrix A.

Thanks a lot & great work?

-AAA

07 Feb 2007 a a  
12 Feb 2007 mc k  
30 May 2007 Golnaz Habibi  
16 Jun 2007 E. Hearn

I am sure this works well, but it needs clearer documentation. I simply cannot understand the format.
"The region(s) x is a subset of R2/R3 s.t. A*x>=b and lb<=x<=ub" is rather cryptic.

22 Oct 2007 PA L

interesting

26 Nov 2007 Steven Randolph  
05 Dec 2007 Jianing Di

I think it is very useful.

18 Dec 2007 Juan Carlos Trillo

I was looking for something similar, great!
Only one question, how can one do to appropiately define the planes to plot general closed regions?

03 Jul 2008 Thierry Dalon

Good contribution!

13 Oct 2008 Rodrigo Lopez

very good! just what i need for my thesis. Thanks!

Juan Carlos: You can close your polyhedron by adding goods upper and lower bounds.

14 Jun 2010 Magnus

Thanks for a nice package - it saved me quite some time! A hint to users: You get the error "Vector must have 4, 6, or 8 elements." if you specify an unfeasible set, i.e. if your A and b are such that no x fulfill Ax >= b. In my case, it was because I happened to define the normal vectors so they point out instead of in, i.e., the sign of A was reversed.

Please login to add a comment or rating.
Updates
07 Dec 2005

Uncomplete description

17 Jan 2006

John D'Errico had an idea how to do the program more user-friendly. That was by adding simpe bounds, lb & ub, to the arguments. So I did.

26 Jun 2007

Have done the documentation more clear.

04 Jan 2010

More examples are added.

Tag Activity for this File
Tag Applied By Date/Time
specialized Per Bergström 22 Oct 2008 08:08:57
plotting Per Bergström 22 Oct 2008 08:08:57
plot Per Bergström 22 Oct 2008 08:08:57
region Per Bergström 22 Oct 2008 08:08:57
surface Per Bergström 22 Oct 2008 08:08:57
subset Per Bergström 22 Oct 2008 08:08:57
polyhedron Per Bergström 22 Oct 2008 08:08:57
3d Per Bergström 22 Oct 2008 08:08:57
2d Per Bergström 22 Oct 2008 08:08:57
3d Matthew Galati 19 Sep 2009 19:07:40
hexahedron ths1104 Stenkhiste 23 Aug 2010 03:54:33
tetrahedron ths1104 Stenkhiste 23 Aug 2010 03:54:46
polyhedron ths1104 Stenkhiste 23 Aug 2010 03:55:11
3d maryam 30 Oct 2011 22:57:46
polyhedron mengheng 18 Dec 2011 05:45:28

Contact us at files@mathworks.com