Random number generator between two numbers - MatLab

前端 未结 3 1562
情歌与酒
情歌与酒 2020-12-18 14:10

I am trying to create a random number generator between two numbers in MatLab but I am unable to figure out the correct equation.

I know that you can use the r

3条回答
  •  渐次进展
    2020-12-18 14:46

    The answer for adjusting the interval is listed in the help section on rand() :

    Example 1

    Generate values from the uniform distribution on the interval [a, b]: r = a + (b-a).*rand(100,1);

提交回复
热议问题