How to generate binary samples

조회 수: 2 (최근 30일)
Thirunavukkarasu
Thirunavukkarasu 2014년 8월 30일
답변: the cyclist 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