How can I find the indices in the accumarray syntax below, Thanks in advance
accumarray(OrbNO,elev,[],@(x) max(x)-min(x), 0);

1 件のコメント

Oday Shahadh
Oday Shahadh 2017 年 1 月 10 日
You are great Walter.. Thanks

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

 採用された回答

Walter Roberson
Walter Roberson 2017 年 1 月 10 日

1 投票

function idx = maxidx(x)
[~, idx] = max(x);
function idx = minidx(x)
[~, idx] = min(x);
Together with
accumarray(OrbNO,elev,[],@(x) maxidx(x)-minidx(x), 0);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeNumeric Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by