- Read your data to a Matlab variable (even load might work here).
- Generate a vector of 1000 integers between 1 and 51360-48. The randi function should work for you.
- Create a vector in the opposite direction of the one in step 2 with the values 0 to 48-1. The colon operator is enough. Mind the parentheses and use .' to flip the direction if needed.
- Add the two vectors together, using implicit expansion (older Matlab releases will require bsxfun(@plus,__,__) to do this).
- Use the resulting array to index into your loaded data. Depending on what you did in step 2 and 3, either each row or each column will be a sample.
How to randomly select sub-sets from an array?
조회 수: 7 (최근 30일)
이전 댓글 표시
답변 (1개)
Rik
2020년 12월 18일
댓글 수: 5
Rik
2020년 12월 18일
Try it. If you have issues implementing one of these steps, show the code you tried. It is not hard. You can do it. Just follow the steps I showed you. Is there any step you don't understand?
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!