Hi all nice holiday ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
ABDULLA RAHIL
am 22 Dez. 2015
Bearbeitet: James Tursa
am 22 Dez. 2015
to generate data between 0.04 and 0.07 using this formula below or nay other formulas, my question i need to put this equation in the loop so i dont want to add the rows and column numbers how can i do that any help is really appreciated r = a + (b-a).*rand(100,1);
0 Kommentare
Akzeptierte Antwort
James Tursa
am 22 Dez. 2015
Is this what you want? It generates the random numbers, then in a loop uses the k'th sample r(k).
a = 0.04;
b = 0.07;
n = 100;
r = a + (b-a).*rand(n,1);
for k=1:n
% Use r(k) here in your code
end
3 Kommentare
James Tursa
am 22 Dez. 2015
Bearbeitet: James Tursa
am 22 Dez. 2015
p(i)= 0.04 + (0.07-0.04)*rand; % <-- Use rand without inputs to get scalar result
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Holidays / Seasons 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!