Find cell with nearest value

1 visualización (últimos 30 días)
Setiadi Suriana
Setiadi Suriana el 23 de Mayo de 2019
Respondida: Setiadi Suriana el 23 de Mayo de 2019
I have cell array 1x406 which each cell has a value. And I want to find a cell with the value nearest to 0. In this case i want output is 175. Thank youVal.JPG

Respuesta aceptada

madhan ravi
madhan ravi el 23 de Mayo de 2019
C = [yourcell{:}]; % assuming each cell contains a scalar
[Value,Where] = min(C(C>0 & C<1))

Más respuestas (1)

Setiadi Suriana
Setiadi Suriana el 23 de Mayo de 2019
It is solved. Thank you

Categorías

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

Etiquetas

Productos


Versión

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by