How do I use rand() to generate two vectors with n number of elements?

33 ビュー (過去 30 日間)
JoyAnne Jernigan
JoyAnne Jernigan 2020 年 10 月 1 日
コメント済み: JoyAnne Jernigan 2020 年 10 月 1 日
How do I use rand() to generate two vectors with 10000 elements? Trying to make the elements in the vectors range between 0 and 100 uniformly.

回答 (1 件)

Mohammad Sami
Mohammad Sami 2020 年 10 月 1 日
vector = rand(10000,1)*100;
% if you want integers
vector = randi(100,10000,1);

カテゴリ

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