Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

remove rows with duplicates

1 visualización (últimos 30 días)
alpedhuez
alpedhuez el 19 de Abr. de 2019
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Consider a following spreadsheet
Column 1 2 3
10 10 10
11 10 9
11 10 10
In this setting I want to delete Row 2 and Row 3 because they have duplicates in Column 1.
More generally, the problem is "I would like to delete any row that has a duplicate in Column 1." Please advise how to proceed

Respuestas (1)

Walter Roberson
Walter Roberson el 20 de Abr. de 2019
need_to_delete = [false; any(ismember(YourArray(2:end,:), YourArray(1,:)),2)];
YourArray(need_to_delete, :) = [];

Etiquetas

Productos


Versión

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by