Delete specific rows on a large matrix?
2 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
Abdulrahman Abdulaziz S Aljurbua
2020-6-2
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!