How to set WaitSecs for several durations?

8 views (last 30 days)
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);

Accepted Answer

Ameer Hamza
Ameer Hamza on 20 Oct 2020
Try this
rs = [1.0 1.5 2.0];
idx = randi(numel(rs));

More Answers (0)


Community Treasure Hunt

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

Start Hunting!

Translated by