MATLAB: Generating random numbers using for loop random number generator Hi, Shall i use the following code to generate random numbers and use them further in the calculation? clear allclose all for n=1:2; h(n)=rand end Best Answer If you like. you could instead pass size information to rand to say how many items to generate . Related SolutionsMATLAB: How to generate dibits using uniform number generator N = 20;dibits = complex(randi([0,1], N, 1), randi([0,1], N, 1)) MATLAB: Random numbers help randdoc rand Related QuestionGenerate Random Sample between [0,1)Random numbersHow to generate same set of random numbersGenerating random numbers without repitiionGenerating random numbersHow to generate random integer between two no (say 12 and 35) without repeat? randperm(n) give only 1 to n, but I need m to n.Generating random numbers
Best Answer