What does this vector assignment mean?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Lucas Buckels
am 3 Apr. 2017
Beantwortet: Thorsten
am 4 Apr. 2017
diceLeft = 5
dice = []
dice = [dice randi([1,6],1,diceLeft)];
0 Kommentare
Akzeptierte Antwort
Thorsten
am 4 Apr. 2017
That's easy:
randi([1,6],1,diceLeft)
generates a 1 x diceLeft matrix of random integer values from the interval [1,6].
For the first call of
dice = [dice randi([1,6],1,diceLeft)];
when dice is empty, you get these diceLeft numbers; for subsequent calls of
dice = [dice randi([1,6],1,diceLeft)];
you add diceLeft new random numbers.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!