How to select a random number from a matrix
이전 댓글 표시
Hii
I have a matrix A=[2;5;3;6]
How can I select a random number from this matrix A
답변 (1개)
Guillaume
2019년 4월 25일
Use randi to select an index at random:
A(randi(numel(A)))
카테고리
도움말 센터 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!