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.

  • oleg: The author has implemented skewness, kurtosis and checks answering appropriately to the critic.
  • Ashok: how to store 10 or more random number in a loop a loop for i = 1:n mean(i) = input(’enter the mean value...
  • Ben: Doug, Thanks for the very helpful videos! Uitables seem like a convenient way to make a customized property...
  • oleg: Allstats has no checks, no comments and could also be improved (talking about prctile implementatio). Not to...
  • Todd: Additional information and a link to download free MATLAB and Simulink LEGO MINDSTORMS NXT code can be found at...
  • Doug: @Leo, Here is the “English version” of that code. “vec = []” makes an empty variable...
  • leo: Dear Doug I have a question in your code ‘October 9th, 2009 at 13:53′ vec = []; vec = [vec val]; I...
  • Shanker Keshavdas: You sir, are a gentleman and a scholar… No really, helped me out a lot. As to what is...
  • Quan Zheng: how can I get a copy of stepspecs.m?
  • Doug: @Lucy I think this is what you seek to move a line with the mouse in MATLAB. http://blogs.math...

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