View Single Post
Old 09-22-2003, 07:18 AM   #1 (permalink)
Scorpion23
Psycho
 
Scorpion23's Avatar
 
Help with random numbers in Matlab

Does anyone know how to generate a matrix or sequence of random numbers in Matlab? The numbers have to fall inside a ellipse of equation:
t=[0:2*pi/100:2*pi];
x=5*cos(t);
y=1*sin(t);
plot(x,y,'.')
or any other ellipse/shape.
The end result would be an ellipse filled with random points.
I've tried looking for a command that would generate points within a constraint but to no avail.
Scorpion23 is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60