Write a Matlab function r = random(x,y) which takes as input two integers x and y, and generates and returns a random integer that is equally likely to take any value between x and y?
Then, write a program use random() to generate 100,000 random numbers between 1 and 10. Store each random number in an vector.
Heres what I got so far:
function r = random(x,y) r = floor(x + y.*rand(n,1)) ??? end
program: n = 100000; x = 1; y = 10; r = random(x,y);
Best Answer