Find cell with nearest value
5 次查看(过去 30 天)
显示 更早的评论
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 you

0 个评论
采纳的回答
madhan ravi
2019-5-23
C = [yourcell{:}]; % assuming each cell contains a scalar
[Value,Where] = min(C(C>0 & C<1))
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!