to combine different vectors with the same element
Mostrar comentarios más antiguos
In matlab, which command can combine different vectors, and form a new vector like a boolean merge,for example, I have three vectors,[1 2 3 4], [2 4 5],[ 1 5 6],by using this command, a new vector [1 2 3 4 5 6]is formed, where only one of the same elements is left and these element are in series from small to large
1 comentario
Stephen23
el 21 de Feb. de 2016
See Star Strider's answer for the simplest solution.
Respuesta aceptada
Más respuestas (1)
Star Strider
el 21 de Feb. de 2016
A completely unique experience:
three_vectors = [[1 2 3 4], [2 4 5],[ 1 5 6]];
new_vector = unique(three_vectors)
new_vector =
1 2 3 4 5 6
Categorías
Más información sobre MATLAB 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!