Delete specific rows on a large matrix?
이전 댓글 표시
Hello everyone,
I need some help, on a problem which looked pretty basic at the beginning. I have a very big matrix with 10947479 rows and 3 columns. But I don't need the values above 200 and it should remove the whole row. I tried like below:
idx = V1(:,2) >= 200;
V1(idx,:) = [];
Unfortunatly, the result is very bad. In the matrix are zeros now, while in the original matrix are none zeros at all. If I run the code like this:
V1(idx(1:10000),:) = [];
it works as supposed. I don't no why :( Does anyone know how I can solve my problem?
답변 (1개)
Abdulrahman Abdulaziz S Aljurbua
2020년 6월 2일
0 개 추천
Hi ..
Did you try:
V1(201:end,:) = 0
This is supposed to make any row below the 200th enrty = 0.
or
V2 = V1(1:200,:) ;
This will store the value of the first 200 rows ov V1 in V2.
카테고리
도움말 센터 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!