Generate a random number in a certain range in MATLAB

前端 未结 9 1479
误落风尘
误落风尘 2020-11-28 10:08

How can I generate a random number in MATLAB between 13 and 20?

9条回答
  •  庸人自扰
    2020-11-28 11:08

    if you are looking to generate all the number within a specific rang randomly then you can try

    r = randi([a b],1,d)
    

    a = start point

    b = end point

    d = how many number you want to generate but keep in mind that d should be less than or equal to b-a

提交回复
热议问题