generate m supporting points (ij) around a typical point (i)

2 views (last 30 days)
I have to generate N random points (i) inside a rectangle (side a x a ) For an unstructured distribution of points, I have a typical point (i) and (ij) a group of points nearest the point (i) (ij is the supporting points of the point i). (xi , yi) and (xij , yij) are the Cartesian coordinates of the point i and ij, respectively. How can I generate m supporting points (ij) of each node (i) with (i=1,2,.....N) ? The radius d(i) of the supporting region associated to the node (i) is calculated :
d(i)=max(sqrt((xij-xi)^2 + (yij-yi)^2))*1.2 for j = 1,2, ..., m i = 1,2, ..., N
If anyone has a sample code or can help me with this, thanks so much for the hep !

Answers (1)

Tuan Dang
Tuan Dang on 25 May 2012
I have a code generate N random points inside a square (a=4m)
%------------Generate N-random points inside a rectangle------------------- clc clear all format short x = 0:0.01:4; y = 0:0.01:4; %N : N random points N = 200; xpts = (4-0).*rand(N,1); ypts = (4-0).*rand(N,1); hold on plot(xpts,ypts,'*')

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!