How to generate binary samples

1 次查看(过去 30 天)
Thirunavukkarasu
Thirunavukkarasu 2014-8-30
how to generate binary sample for given input signals for example xor function of two input signals with 32 binary samples

回答(1 个)

the cyclist
the cyclist 2014-8-30
If you have the Statistics Toolbox, you can use the binornd() function.
Alternatively, you could use randn() or rand():
randn() > 0
rand() > 0.5
will give 50% chance of either 0 or 1.

类别

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