フィルターのクリア

Conditional normal random distribution

1 回表示 (過去 30 日間)
Orr Streicher
Orr Streicher 2021 年 4 月 25 日
コメント済み: Orr Streicher 2021 年 4 月 26 日
Hi,
I would like to create a spiral in matlab while the radius is dependent on the angle theath in the following way:
thate is N daimentional vector sampled from a uniform distrbution. the radius r in sampled from normal conditional distrbusion where the expectation mu is dependent on theata.
How can i define a conditional distrbusion in matalb?
Thanks

採用された回答

Paul
Paul 2021 年 4 月 25 日
I'm going to assume that for any value of theta, the radius (rho) is normally distributed with mean 2*theta and variance = sigma^2 = 1. Then
>> theta=rand(1000,1)*2*pi; % uniformly distributed theta over 0 - 2pi
>> rho=normrnd(2*theta,1);
>> plot(rho.*cos(theta),rho.*sin(theta),'.'
Is this what you're looking for?
  1 件のコメント
Orr Streicher
Orr Streicher 2021 年 4 月 26 日
great theanks!

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by