How to set WaitSecs for several durations?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Takara Sumoto
am 20 Okt. 2020
Kommentiert: Ameer Hamza
am 20 Okt. 2020
I would like to set WaitSecs for several duration such as 1.0s, 1.5s, and 2.0, and randomize them.
How should I write a code?
rs = randperm(3);
WaitSecs(?);
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 20 Okt. 2020
Try this
rs = [1.0 1.5 2.0];
idx = randi(numel(rs));
WaitSecs(rs(idx))
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multidimensional Arrays 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!