How does the command unique work?
Mostrar comentarios más antiguos
Hello,
Someone at my work told me to use unique to get some values out of the array. The array is stored with values [2 3 10 11 12 13 15 17....990]. someone values between 2:990 are missing. No value is repeated, but the unique(array) produces the result [ 2 3 4 5 6 7 8 9 10] which is what I want. Can someone explain me why? I thought that unique outputted sorted unique values of that array.
1 comentario
@ubaid haroon: can you please show us the exact input values that you use, and how you call this function. unique works as expected for me, using the sample values that you gave:
>> unique([2,3,10,11,12,13,15,17,990])
ans =
2 3 10 11 12 13 15 17 990
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Matrices and Arrays 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!