random pick cell array
조회 수: 4 (최근 30일)
이전 댓글 표시
how to randomly picking in cell array? for example,i want to pick randomly one data in x.
x=[1;8;9;10;16]
댓글 수: 0
답변 (1개)
Paulo Silva
2011년 5월 7일
x=[1;8;9;10;16]; %is one array not cell array
x(randi([1 numel(x)])) %show one random element of the array
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!