Storing values outside a range

I have a 20x1 matrix and I would like to store all the elements that lie OUTSIDE the range in a new matrix. Which operator can I use?

Respuestas (1)

Walter Roberson
Walter Roberson el 20 de Mzo. de 2020

0 votos

There is no range-test operator in MATLAB. You will have to do the usual test of whether the values are greater than the last element of the range or less than the first element of the range.
Hint: use logical indexing.

Etiquetas

Preguntada:

el 19 de Mzo. de 2020

Respondida:

el 20 de Mzo. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by