i want to generating random numbers on matrix 1x30
how i get generating 2 random numbers (only 1 and 4 , not between) ???

 Akzeptierte Antwort

Chunru
Chunru am 17 Sep. 2021
Bearbeitet: Chunru am 17 Sep. 2021
a = randi([0 1], [1 30])*3 + 1
a = 1×30
1 1 4 4 4 4 4 1 1 4 1 4 4 4 1 4 4 4 1 1 1 4 1 4 4 1 4 4 4 4

2 Kommentare

Takim Mustakim
Takim Mustakim am 17 Sep. 2021
ohhhh thank you bro/sist
Chunru
Chunru am 17 Sep. 2021
Consider to accept the answer.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Random Number Generation finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2021a

Gefragt:

am 17 Sep. 2021

Kommentiert:

am 17 Sep. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by