Borrar filtros
Borrar filtros

To know what number is not available in an array.

1 visualización (últimos 30 días)
fyza affandi
fyza affandi el 28 de Feb. de 2019
Editada: Stephan el 28 de Feb. de 2019
I have an array A
A=[ 1 7 3 8 7 2 6];
Then after sorting the array A,
B=sort(A,ascending);
B=[1 2 3 6 7 8];
How can I know which number it doesnt contained? Which is 4 and 5?

Respuesta aceptada

Stephan
Stephan el 28 de Feb. de 2019
Editada: Stephan el 28 de Feb. de 2019
A=[ 1 7 3 8 7 2 6]
Missing = find(~ismember(min(A):max(A),A))

Más respuestas (0)

Categorías

Más información sobre Data Types en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by