Prev: Using loadlibrary with NVIDIA CUDA (CUBLAS and CUFFT) libraries
Next: error saving desktop configuration
From: henry wang on 11 Apr 2010 19:21 Hi, How do you create a polygon in matlab? I only want the points on the perimeter. Say a hexagon, and I only want N points on the border of the hexagon. How do I do this in matlab? (I know patch returns a polygon but that's not the border) Thanks so much.
From: ImageAnalyst on 11 Apr 2010 20:10
If you have the Image Processing Toolbox, you can use roipoly() or roipolyold(). These will let you hand click on vertices and return the coordinates - if that's what you meant by "create." If you meant just how to draw one from a list of known coordinates, then use the plot() function. If you want ALL the points along the perimeter instead of just the vertices, then you can use poly2mask() followed by bwboundaries(), or use bwperim(), again with the Image Processing Toolbox. Of course you'll have to digitize your space but you know this because you said "N points" when really there can be an infinite number of points in an undigitized space. Well, as you can see there are a lot of unknowns in your vague post so maybe you can explain more fully what you mean. |