How to create Matrix of known dimensions with random values?

45 ビュー (過去 30 日間)
Prathamesh Walunj
Prathamesh Walunj 2021 年 5 月 24 日
回答済み: Shivani Dixit 2021 年 5 月 24 日
For example A matrix with 5 rows and 3 columns?

採用された回答

Shivani Dixit
Shivani Dixit 2021 年 5 月 24 日
A matrix of know dimensions and random values can be created by using the rand() function. You just need to provide the required dimension of row and column in the the rand() function. As per your example, you can create your matrix by rand(5,3)
You can leverage the Matlab documentation of the rand() function , you can also find out related functions in the link below :

その他の回答 (1 件)

Torsten
Torsten 2021 年 5 月 24 日
For random numbers uniformly distributed on [0,1] :
A = rand(5,3);

カテゴリ

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