- The first 20% of the rows, starting from the first row?
- the first 20% of the columns, starting from the first column?
- the first 20% of the elements, starting from the first element?
- the first 20% of the values, when the values are sorted by value?
- something else?
getting first 20% of a matrix
조회 수: 6 (최근 30일)
이전 댓글 표시
I am getting the first 20% of a (290,2) matrix (so a 58,2 matrix). I was just wondering how this is possible. im presuming there are a number of ways but unsure as to how to do it?
댓글 수: 1
Stephen23
2015년 4월 27일
편집: Stephen23
2015년 4월 27일
What do you mean by the "first 20% of a matrix" ?
채택된 답변
Guillaume
2015년 4월 27일
Just use standard matrix indexing:
A = rand(290, 2); %for example;
B = A(1:floor(size(A, 1) * 0.2), :);
댓글 수: 0
추가 답변 (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!