syntax for random number

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

Respuestas (4)

Varsha Nataraj
Varsha Nataraj el 10 de Abr. de 2019

0 votos

cant use them they provide range of output
Steven Lord
Steven Lord el 10 de Abr. de 2019

0 votos

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.

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Preguntada:

el 8 de Abr. de 2019

Respondida:

el 10 de Abr. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by