How do you remove rows from tall arrays?
조회 수: 5 (최근 30일)
이전 댓글 표시
For normal arrays, I would usually use the following code to remove the rows that I did not want.
array(1:100,) = [];
However, I get the following error and can not remove the rows.
For A(m,n,...) = [], m must be either a colon (:) or a tall logical vector.
댓글 수: 2
채택된 답변
Edric Ellis
2022년 4월 4일
As the error message states, the only way to remove specific rows from a tall array is with a logical vector. In other words, the following is valid:
t = tall(rand(100,1));
t(t < 0.2) = []
In your particular case, instead of deleting elements, you can instead simply select the remainder of the array:
t = tall(rand(1000, 1));
t2 = t(101:end)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!