How to select particular elements from an array

6 visualizaciones (últimos 30 días)
Amitrajit Mukherjee
Amitrajit Mukherjee el 8 de En. de 2018
Comentada: Amitrajit Mukherjee el 8 de En. de 2018
Hi, I have an array A = [1 2 3 4 5 6 7 8 9 10], and an another array of lower size B = [2 6 9]..I need to logically find components from B in A so that the result C comes as [1 0 1 1 1 0 1 1 0 1] or [0 1 0 0 0 1 0 0 1 0]..
thanks, Amitrajit

Respuesta aceptada

Birdman
Birdman el 8 de En. de 2018
ismember(A,B)

Más respuestas (0)

Categorías

Más información sobre Operators and Elementary Operations 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