I generate samples in 2-d space, i.e. x,y coordinates. I have a normal pdf and I want to keep/accept the samples that fall inside the pdf. Let as denote this area W. Is there a specific command for this? How can I implement it? I found in Matlab inpolygon command , but it works only for polygonal region and not on curves, such as pdf .