Thread Subject: random data

Subject: random data

From: mark b.

Date: 26 Jun, 2008 14:26:03

Message: 1 of 5

hi,
i've got such a question: i've got an ellipse (know
minor/major axis and it's centre).

how can i generate random data that lies all-around my
ellipse (but not on it!)? ok, some
points can lie on it but not all of them.

      kind regards

Subject: random data

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 26 Jun, 2008 14:33:08

Message: 2 of 5

In article <g408tr$7cb$1@fred.mathworks.com>,
mark b. <john.doe.nospam@mathworks.com> wrote:

>i've got such a question: i've got an ellipse (know
>minor/major axis and it's centre).

>how can i generate random data that lies all-around my
>ellipse (but not on it!)? ok, some
>points can lie on it but not all of them.

Should the data be inside or outside the ellipse? If outside, then
what kind of probability distribution do you want for the distance
away? e.g., probably "most" of the points should be near-by but
perhaps there is a 1 in a million chance that the random point
will be (say) 1000 units away? Single-tailed normal distribution
perhaps??
--
  "The slogans of an inadequate criticism peddle ideas to fashion"
                                              -- Walter Benjamin

Subject: random data

From: mark b.

Date: 26 Jun, 2008 14:41:02

Message: 3 of 5

the best option will be if some of these points lie inside
the ellipse and some of them outside.
about probability distribution i don't care that much.
i mean, they should lie quite close to my ellipse, but it
will be nice if at least few points lies further. but 1000
units away is too far :) for example, let's say max 7 units
away. do You have any idea how to do this? does matlab has
any function to generate it in some simple way?

 kind regards

Subject: random data

From: Titus

Date: 26 Jun, 2008 14:54:27

Message: 4 of 5


"mark b." <john.doe.nospam@mathworks.com> schrieb im Newsbeitrag
news:g409pu$hp1$1@fred.mathworks.com...
> the best option will be if some of these points lie inside
> the ellipse and some of them outside.
> about probability distribution i don't care that much.
> i mean, they should lie quite close to my ellipse, but it
> will be nice if at least few points lies further. but 1000
> units away is too far :) for example, let's say max 7 units
> away. do You have any idea how to do this? does matlab has
> any function to generate it in some simple way?
>
> kind regards
>

If you are not caring too much about the probability, the very simplest way
I could think of would be to calculate points randomly on the ellipse and
add some noise to it:

n = 100;
t = rand(n,1)*(2*pi);
x = 2*cos(t)+0.07*randn(n,1);
y = 3*sin(t)+0.07*randn(n,1);
plot(x,y,'r*', 2*cos(linspace(0,2*pi)), 3*sin(linspace(0,2*pi)),'b-')

Titus


Subject: random data

From: mark b.

Date: 26 Jun, 2008 14:57:02

Message: 5 of 5

thx:)

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com