File Exchange Pick of the Week

January 21st, 2008

Practical Example: Generating points inside a polygon

Notice the link at the bottom for a one minute survey that can get you into a drawing for a MATLAB t-shirt!

This ten minute video shows how to modify the help example for INPOLYGON to generate a set number of points inside of a random polygon. The coding process is shown from beginning to end, with incremental testing, debugging and commentary on my though process.

iconFiles.jpgiconFree.jpgiconPod.jpg

4 Responses to “Practical Example: Generating points inside a polygon”

  1. Ryan Gray replied on :

    It seems there’s a problem again with your M4V conversion. Quicktime and iTunes say it’s MPEG-4 video, but they don’t think it has a video track and only play audio.

  2. Doug replied on :

    Ryan,

    Seems there was a slight change in file output since I wrote my MATLAB scripts that automate FTPing the files up to the server. Problem solved now. Thanks!

    Doug

  3. siv replied on :

    we have a data that contains long,lat and data values we have to plot a grid image using that data values how to get a grid image

    and we have to mask the grid image to india polygon

  4. Doug replied on :

    @sivi,

    You might want the mapping toolbox, dependent on what you are doing.

    I think you should send the details of what you are doing to:

    http://www.mathworks.com/support

    Doug

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


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.