How can I randomly generate data pairs?

Respuestas (1)

Prasanth Sunkara
Prasanth Sunkara el 16 de Feb. de 2018
Hi Yusha, There are multiple ways to do that. One way is using randi to generate each column with the appropriate constraints and concatenate them later as shown below:
z=randi([0 4],1000,1);
x=randi([0 1],1000,1);
randomPairs = [z x];
Let me know if this helps.
-Prasanth

Categorías

Más información sobre 随机数生成 en Centro de ayuda y File Exchange.

Preguntada:

el 15 de En. de 2018

Respondida:

el 16 de Feb. de 2018

Community Treasure Hunt

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

Start Hunting!