random disc

Upload: rahul-kumar-meena

Post on 02-Mar-2016

213 views

Category:

Documents


0 download

DESCRIPTION

this document shows how to generate Random disc. signal importance.

TRANSCRIPT

  • function [xCoordinates,yCoordinates] = randomDisc(numPoints) xCoordinates = []; yCoordinates = []; %Helper function that samples a random integer from the uniform %distribution between -15 and 15. function nums = randInt(n) nums = round((31*rand(n,1))-15.5); end n = numPoints; while n > 0 x = randInt(n); y = randInt(n); norms = sqrt((x.^2) + (y.^2)); inBounds = find((10