Comparing uneven sized matrix and delete rows which are not common
Mostrar comentarios más antiguos
Hi guys. I hope this quation finds you well.
For my project i need to compare two uneven matriz row by row. If the rows are not equal beteween column 2 and 5 in a line, delete the line which de index (i+1) is equal to the other matrix index (i). If a rows is deleted, the cycle must restart. Basically i want the column 2 and 5 be exactly equal on both matrices.
For now i have this:
close all;
clc;
D=load('Dir.txt');
L=load('Esq.txt');
D=sortrows(D,6);
L=sortrows(L,6);
for i=1:length(L);
if D(i , 5) ~= L(i , 5) | D(i , 2) ~= L(i , 2)
return
end
end
But i have to manually delete the rows. Is there an option to do this automatically?
I have to delete more than 70000 rows so if i do it manually i'll be done some time next year XD.
Thanks in advance.
P.S: The files are attached
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!