File Exchange Pick of the Week

January 18th, 2006

PLOTREGION

Here’s another entry from our guest picker, John D’Errico, as Doug and I enjoy another week relaxing …

Have you ever wanted to visualize the feasible set from a set of inequalities? It’s perhaps not for everyone, but if you do many optimizations, you will want to do this sometime. Per Bergström gives us the nice utility PLOTREGION. It takes a set of linear inequality constraints plus additional bound constraints, and creates a pretty figure. Even if all you
need to do is make a nice 3d box in a plot, plotregion should be of help.

Sadly, plotregion works only in 2D or 3D. I can accept that for now, at least until my 4-D holographic monitor comes back from the repair shop.

By the way, here is a tip for all of us to follow. Have you ever wanted to publish your favorite function on the file exchange? Before you do, run it through mlint. Mlint will point out a variety of problems that you may never have noticed. Mlint is a great habit to get into. It may show you how to make your code more efficient, or just find those lines that you forgot to terminate with a semicolon. It can also pick up potential problems for the future if you have used a function or programming style that will be obsolete in a coming release.

[Scott’s Note: M-Lint was introduced in MATLAB 7.]

Comments are closed.


Bob, Brett & Jiro share their favorite user-contributed submissions from the File Exchange.

  • Zach: Hi Doug and Les, I didn’t have a lot of time to mess with this, but I did find a work-around. I plotted...
  • hamed: k
  • Les: @Zach This isn’t exactly what you are looking for but at least it puts all three parameters on the same...
  • Zach: Thanks for your suggestions Doug. I’ll give that a shot and see what happens. I’ve seen many of...
  • Doug: @Zach, I would say to use plotYYY, because that is close to what you want, but using depth as Y makes sense....
  • Doug: @Teja, I think this will work: http://www.mathworks .com/access/helpdesk /help/techdoc/ref...
  • Gify: merry christmas :) nice christmas tree! Regards, Janet Gify
  • Teja: Dear Doug Is there anyway to plot a surface from nonuniform data without meshgrid and griddata? Basically i...
  • Zach: I’m working with geophysical data, so I’d like to produce a depth profile. The y-axis would be...
  • Doug: @Ashok First, please do not use variable names that are MATLAB commands (std and mean). Second, p(j) should be...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.