syntax for random number
3 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(4 个)
madhan ravi
2019-4-8
https://in.mathworks.com/help/matlab/ref/rand.html - see under Topics , you will find lot of resources
0 个评论
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Random Number Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!