How to find those indices that before and including the maxium value of an cell array?

2 ビュー (過去 30 日間)
Yang SONG
Yang SONG 2020 年 11 月 24 日
コメント済み: dpb 2020 年 11 月 24 日
I have a cell maxtrix(see attachment) and I can label the index of the maxium value(the output only labels maximum value as 1 and others as 0 for each cell ) by using this syntax:
x = cellfun(@(x) x==nanmax(x),cellmatrix,'UniformOutput', false);
however, I wonder to know how do I find those indices before and also including the maximum value by using cellfun(i.e. the output labels all those values before and including maxium value as 1 and others as 0 for each cell)?
Thanks for your help.
  1 件のコメント
dpb
dpb 2020 年 11 月 24 日
Isn't clear to me just what you want -- how about cutting the sample data array down to a minimal set that can look at visually (10 elements is just as good as 10,000 for coding purposes) and show us both input and an expected output.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by