hello If I have for example a vector k=[1,2,3,4,5,6,7,8] and a vector i=[3,4,6,7] and I want to obtain a vector that contains element in k but not in i, it means here I want the vector [1,2,5,8] thanks in advance

 Respuesta aceptada

per isakson
per isakson el 9 de Dic. de 2016

1 voto

setdiff does it
>> k=[1,2,3,4,5,6,7,8]; i =[3,4,6,7];
>> setdiff( k, i )
ans =
1 2 5 8

Más respuestas (0)

Categorías

Más información sobre Modeling en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 9 de Dic. de 2016

Comentada:

el 10 de Dic. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by