Effacer les filtres
Effacer les filtres

how to generate samples uisng pseudo random generator

2 vues (au cours des 30 derniers jours)
Thirunavukkarasu
Thirunavukkarasu le 27 Août 2014
Commenté : Star Strider le 30 Août 2014
how to generate xor samples using pseudo random number generator
  2 commentaires
dpb
dpb le 27 Août 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.
Thirunavukkarasu
Thirunavukkarasu le 29 Août 2014
XOR input samples were generated by using a threshold function for 1000 values from a uniformly distributed pseudorandom number generator. The threshold function had a threshold level of 0.5. Sample = ( 1 ; value > 0:5 0 ; value >= 0:5

Connectez-vous pour commenter.

Réponse acceptée

Star Strider
Star Strider le 27 Août 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 commentaires
Thirunavukkarasu
Thirunavukkarasu le 30 Août 2014
value is 1 when sample value greater than 0.5 and 0 when it is less than or equal to 0.5
Star Strider
Star Strider le 30 Août 2014
That is exactly what ‘rn’ does. (The original continuous vector is ‘rv’.)

Connectez-vous pour commenter.

Plus de réponses (1)

Image Analyst
Image Analyst le 30 Août 2014
inputSamples = rand(1,1000) > 0.5;

Catégories

En savoir plus sur Big Data Processing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by