Comparing Two Different Arrays

1 visualización (últimos 30 días)
Serra Aksoy
Serra Aksoy el 4 de Feb. de 2020
Comentada: Serra Aksoy el 4 de Feb. de 2020
Hi,
I have two arrays: A=[ 10 20 30 40 50 ] and B=[ 12 22 32 42 52 ]
Here the min(A)= 10 and the max(A)=50
Let's take b ∈ B.
I would like to find the elements of B that satisfy the following condition: min(A) < b < max(A)
If an element of B satisfy this condition it should be 1 in a new array X , if it does not satisfy this condition it should be 0 in a new array X.
So in this example i need an array like : X=[ 1 1 1 1 0 ]
Any help is appreciated.

Respuesta aceptada

Bhaskar R
Bhaskar R el 4 de Feb. de 2020
X = B>min(A) & B<max(A);

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays 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