MATLAB: Find cell with nearest value

cell arraysMATLABnearest

I have cell array 1×406 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

Best Answer

C = [yourcell{:}]; % assuming each cell contains a scalar
[Value,Where] = min(C(C>0 & C<1))
Related Question