How to generate random numbers?

11 visualizaciones (últimos 30 días)
Raja R
Raja R el 6 de Mayo de 2016
Editada: Azzi Abdelmalek el 6 de Mayo de 2016
I wan random number in the range of 10 to 50 but with two decimals of size 1X5
Eg:[10 10.25 13 14.25 45.63] It may be any random numbers

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 6 de Mayo de 2016
Editada: Azzi Abdelmalek el 6 de Mayo de 2016
l1=10;
l2=50;
out=l1+(l2-l1)*rand(1,5);
out=round(out*100)/100

Categorías

Más información sobre Random Number Generation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by