Can I ask how this run?

1 回表示 (過去 30 日間)
Huy Pham Quoc
Huy Pham Quoc 2020 年 4 月 22 日
コメント済み: Ameer Hamza 2020 年 4 月 23 日
I don't understand how this run and what is the constance stand for. Please explain, thank you!

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 22 日
The "compare to" block converts the random numbers smaller than 0.5 to 1 and larger than 0.5 to 0. I recommend using the "uniform random number block": https://www.mathworks.com/help/releases/R2020a/simulink/slref/uniformrandomnumber.html instead of random number block used in that answer. The uniform random number block only generates a number between 0 and 1. If you set the constant to 0, then you will get all 0s. If you set it to 1 then you will get all 1s. If you set it to some in-between value, then say 0.3, then you will get 30% 1s and 70% 0s.
  2 件のコメント
Huy Pham Quoc
Huy Pham Quoc 2020 年 4 月 23 日
thank you!
Ameer Hamza
Ameer Hamza 2020 年 4 月 23 日
Glad to be of help.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSources についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by