how to generate samples uisng pseudo random generator
2 views (last 30 days)
Show older comments
Thirunavukkarasu
on 27 Aug 2014
Commented: Star Strider
on 30 Aug 2014
how to generate xor samples using pseudo random number generator
2 Comments
dpb
on 27 Aug 2014
doc rand % and friends for the RNGs in Matlab
what, and how, xor comes into play is totally unclear from what little was provided.
Accepted Answer
Star Strider
on 27 Aug 2014
I am not certain that I understand what you want to do, but I will make an attempt at answering:
nrows = 5;
s = logical(randi(2, nrows, 2)-1);
out = xor(s(:,1),s(:,2));
4 Comments
Star Strider
on 30 Aug 2014
That is exactly what ‘rn’ does. (The original continuous vector is ‘rv’.)
More Answers (1)
See Also
Categories
Find more on Random Number Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!