Get index of smallest vlaue in each cell of cell array
2 次查看(过去 30 天)
显示 更早的评论
I have a cell array with e.g. 40x1 cell and I want for each cell the index of the smallest value. i think smth like find(min(..)). but when i try it with this i allways get the index 1 ...thank you for your help
0 个评论
采纳的回答
Andrei Bobrov
2019-10-15
编辑:Andrei Bobrov
2019-10-15
Let cell_array - your cell array (40 x 1).
cellfun(@(x)find(min(x) == x),cell_array)
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!