syntax for random number

1 回表示 (過去 30 日間)
Varsha Nataraj
Varsha Nataraj 2019 年 4 月 8 日
回答済み: Steven Lord 2019 年 4 月 10 日
i need a syntax that generate one number in random from a range of numbers.
Can anyone tell me the syntax,
this is a python function random.randrange(50, 500, 10) i need the function which works in matlab

回答 (4 件)

KSSV
KSSV 2019 年 4 月 8 日
編集済み: KSSV 2019 年 4 月 8 日

madhan ravi
madhan ravi 2019 年 4 月 8 日
https://in.mathworks.com/help/matlab/ref/rand.html - see under Topics , you will find lot of resources

Varsha Nataraj
Varsha Nataraj 2019 年 4 月 10 日
cant use them they provide range of output

Steven Lord
Steven Lord 2019 年 4 月 10 日
Take a look at the randi or randperm functions.
If you need to generate numbers from a set that contains non-integer values, or a set that is not consecutive integers, use those functions to generate an index and use linear indexing to extract the appropriate numbers from the set.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by