How to set WaitSecs for several durations?
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Takara Sumoto
il 20 Ott 2020
Commentato: Ameer Hamza
il 20 Ott 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 Commenti
Risposta accettata
Ameer Hamza
il 20 Ott 2020
Try this
rs = [1.0 1.5 2.0];
idx = randi(numel(rs));
WaitSecs(rs(idx))
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Multidimensional Arrays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!