4.0

4.0 | 1 rating Rate this file 32 downloads (last 30 days) File Size: 20.16 MB File ID: #18349

Generate random points in a polygon

by Doug Hull

 

17 Jan 2008 (Updated 18 Jan 2008)

Code covered by BSD License  

Tne minute video modifies a stock example to generate a random polygon and place random points in it

Download Now | Watch this File

File Information
Description

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.
      
See more videos without downloading here:
http://blogs.mathworks.com/pick/category/video

MATLAB release MATLAB 7.5 (R2007b)
Zip File Content  
HTML Files Video from http://blogs.mathworks.com/pick
Other Files
71 Practical In poly.css,
71 Practical In poly.flv,
mCode/scratch.m,
71 Practical In poly.js,
71 Practical In poly_config.xml,
71 Practical In poly_controller.swf,
71 Practical In poly_iPod.m4v,
71 Practical In poly_nofp_bg.gif,
71 Practical In poly_preload.swf,
Additional-embed.js,
ProductionInfo.xml,
swfobject.js,
images/bottom_center.jpg,
images/bottom_center_left.jpg,
images/bottom_left.jpg,
images/bottom_right.jpg,
mCode/main.m,
images/dl_bkgd.gif,
images/dl_icon.gif,
images/dl_icon_bkgd.gif,
images/dl_icon_bkgd_over.gif,
images/dl_row_bkgd.gif,
images/play_bttn_bkgd.gif,
images/play_icon.gif,
images/spacer.gif,
images/top_center.gif,
images/top_center.jpg,
images/top_center_clr.gif,
images/top_left_corner.jpg,
images/top_right_corner.jpg,
images/vid_bkgd.gif,
images/curain_bkgd.gif
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
19 Jan 2008 w s

Nice example. One thing I'd like you to mention is preallocation of your coordinate vectors. As soon as these vectors become larger ML will slow down. For beginners these kind of tips and tricks will be probably most useful.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
video Doug Hull 22 Oct 2008 09:42:56
tutorial Doug Hull 22 Oct 2008 09:42:56
geometry Doug Hull 22 Oct 2008 09:42:56
polygon Doug Hull 22 Oct 2008 09:42:56
triangle Doug Hull 22 Oct 2008 09:42:56
outside Doug Hull 22 Oct 2008 09:42:56
inside Doug Hull 22 Oct 2008 09:42:56
polygon Alexandra 02 Dec 2008 14:57:44
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com