using the mod function to create and even random number generator in matlab

28 次查看(过去 30 天)
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.

回答(1 个)

John D'Errico
John D'Errico 2020-1-27
Why do you need the mod function? Just generate random integers, and then MULTIPLY THEM BY 2.

类别

Help CenterFile Exchange 中查找有关 Random Number Generation 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by