using the mod function to create and even random number generator in matlab
Mostra commenti meno recenti
using the vector i created called random20
random20 = randi ([0,100],1,20);
how do i use the mod function to get all even random integers
any help would be appreciated.
2 Commenti
James Tursa
il 27 Gen 2020
Modificato: James Tursa
il 27 Gen 2020
Hint: What does mod(random20,2) give you? Can you use that to get the even ones?
Alex Perez
il 27 Gen 2020
Risposte (1)
John D'Errico
il 27 Gen 2020
0 voti
Why do you need the mod function? Just generate random integers, and then MULTIPLY THEM BY 2.
Categorie
Scopri di più su Random Number Generation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
