how to generate non integer random number in between two numbers.

27 ビュー (過去 30 日間)
Jay Hanuman
Jay Hanuman 2016 年 10 月 22 日
コメント済み: AB WAHEED LONE 2021 年 2 月 1 日
I want to generate single random number which is in between 0.86 and 1. how to generate it.
  1 件のコメント
AB WAHEED LONE
AB WAHEED LONE 2021 年 2 月 1 日
x=low+(high-low)*rand()
Here low is 0.86 and high is 1

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

回答 (1 件)

Star Strider
Star Strider 2016 年 10 月 22 日
Try this:
desired_random_number = 0.86 + (1 - 0.86) * rand;

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by