Find the index of an interval of values in cell array

7 visualizaciones (últimos 30 días)
Tesla
Tesla el 21 de Oct. de 2021
Comentada: Stephen23 el 21 de Oct. de 2021
I have a cell array 1X500, and inside evey cell 6000 value.
I want to find the index on the values (it has to be between 1 and 500) if the values s are : 500<s< 956
I tried with
index = cellfun(@(x) 500 < x < 956, SS, 'uniform', false);
But I didnt get the index

Respuestas (1)

Stephen23
Stephen23 el 21 de Oct. de 2021
index = cellfun(@(x) 500<x & x<956, SS, 'uniform', false);
  2 comentarios
Tesla
Tesla el 21 de Oct. de 2021
It gaves the same results,
I want to return just the index of which cell we have 500<x & x<956. for example getting an output like [ 2 10 23 89 200]
Stephen23
Stephen23 el 21 de Oct. de 2021
index = find(cellfun(@(x) any(500<x(:) & x(:)<956), SS))

Iniciar sesión para comentar.

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by