Delete specific rows on a large matrix?
Mostrar comentarios más antiguos
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?
Respuestas (1)
Abdulrahman Abdulaziz S Aljurbua
el 2 de Jun. de 2020
0 votos
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.
Categorías
Más información sobre Resizing and Reshaping Matrices en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!