Generating a random matrix with range
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Melwin Thomas
am 5 Jun. 2018
Kommentiert: Melwin Thomas
am 5 Jun. 2018
Hi,
I am trying to generate 12*2 matrix. The first column should contain random values between [0 5] and the second column should have random values between [5 20]. Can you help me out with this.
0 Kommentare
Akzeptierte Antwort
Kodavati Mahendra
am 5 Jun. 2018
May be something crude like this?
x = rand(12,2);
x(:,1) = 5*x(:,1);
x(:,2) = 5+15*x(:,2)
rand generates uniformly distributed random number in the interval (0,1).
3 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Random Number Generation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!