How to generate gaussain random sequence with mean = 817e-9 and standard deviation = 10e-9 and probability = 0.25 (total 50 numbers)

 採用された回答

Dyuman Joshi
Dyuman Joshi 2024 年 4 月 22 日

0 投票

Use randn to generate the sequences and modify it accordingly -
avg = 817e-9;
sd = 10e-9;
N = 50;
seq = avg + sd*randn(1, N)
seq = 1x50
1.0e-06 * 0.8245 0.7998 0.8200 0.8049 0.8297 0.8339 0.7922 0.8071 0.8122 0.8261 0.8032 0.8064 0.8150 0.8077 0.7972 0.8003 0.8210 0.8219 0.8206 0.8213 0.8189 0.8115 0.8254 0.8195 0.8034 0.8113 0.8140 0.8268 0.8225 0.8444
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
I am not sure about the probability, so I asked MATLAB AI Chat Playground about that and it provided the following -
seq(rand(1,N)>0.25) = 0
seq = 1x50
1.0e-06 * 0.8245 0 0 0 0.8297 0 0 0 0.8122 0 0 0 0 0 0 0.8003 0 0.8219 0 0.8213 0 0 0 0.8195 0 0 0.8140 0 0 0
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>

3 件のコメント

GULZAR
GULZAR 2024 年 4 月 22 日
I need the sequence accordingly by gaussian distribution
Dyuman Joshi
Dyuman Joshi 2024 年 4 月 22 日
編集済み: Dyuman Joshi 2024 年 4 月 22 日
@GULZAR, Normal distribution is just another name for Gaussian distribution.
GULZAR
GULZAR 2024 年 4 月 23 日
Okay thank you

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeRandom Number Generation についてさらに検索

製品

リリース

R2022a

質問済み:

2024 年 4 月 22 日

コメント済み:

2024 年 4 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by