How to set WaitSecs for several durations?
조회 수: 7 (최근 30일)
이전 댓글 표시
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
채택된 답변
Ameer Hamza
2020년 10월 20일
Try this
rs = [1.0 1.5 2.0];
idx = randi(numel(rs));
WaitSecs(rs(idx))
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!