removing specifics elements from a matrix
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
giuseppe insignito
el 26 de Nov. de 2020
Comentada: Stephen23
el 26 de Nov. de 2020
I have the following matrix
acomb_w =
1 1
2 1
3 1
4 1
1 2
2 2
3 2
4 2
1 3
2 3
3 3
4 3
1 4
2 4
3 4
4 4
I need to get rid, automatically, of all the rows with doubles, so that:
acomb_w =
2 1
3 1
4 1
1 2
3 2
4 2
1 3
2 3
4 3
1 4
2 4
3 4
Can anyone help me?
Thanks!
0 comentarios
Respuesta aceptada
Stephen23
el 26 de Nov. de 2020
Editada: Stephen23
el 26 de Nov. de 2020
acomb_w = [...
1 1
2 1
3 1
4 1
1 2
2 2
3 2
4 2
1 3
2 3
3 3
4 3
1 4
2 4
3 4
4 4];
acomb_w(~diff(acomb_w,1,2),:) = []
... some rows truncated here
2 comentarios
Stephen23
el 26 de Nov. de 2020
@giuseppe insignito : I'm glad. Please remember to accept my answer!
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!