Hi everybody, I would like to know how to solve the following problem.
A=[0 0 1 1]
B=[0]
where B has got only one component. ex. My goal is to delete the components A(1 2) automatically and obtaining
C=[1 1].
The 'A' vector is obtained afther for loop,but I don't know how many components are zero and one, while 'B' is known. My goal is to delete the components A(1 2) automatically and obtaining C=[1 1].
Thank you.

 Respuesta aceptada

Star Strider
Star Strider el 30 de Mayo de 2017

0 votos

One approach:
A=[0 0 1 1];
B=[0];
ia = ismember(A,B);
C = A(~ia)
C =
1 1

2 comentarios

dario cecchetti
dario cecchetti el 30 de Mayo de 2017
Thank you very much!!!!!!!!
Star Strider
Star Strider el 30 de Mayo de 2017
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 30 de Mayo de 2017

Comentada:

el 30 de Mayo de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by