Get index of smallest vlaue in each cell of cell array

2 ビュー (過去 30 日間)
christine schaer
christine schaer 2019 年 10 月 15 日
コメント済み: Andrei Bobrov 2019 年 10 月 15 日
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

採用された回答

Andrei Bobrov
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 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 10 月 15 日
編集済み: KALYAN ACHARJYA 2019 年 10 月 15 日
Sir your Answer's always +1
Andrei Bobrov
Andrei Bobrov 2019 年 10 月 15 日
Thank you KALYAN!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by