Find indices in accumarray syntax

1 Ansicht (letzte 30 Tage)
Oday Shahadh
Oday Shahadh am 10 Jan. 2017
Kommentiert: Oday Shahadh am 10 Jan. 2017
How can I find the indices in the accumarray syntax below, Thanks in advance
accumarray(OrbNO,elev,[],@(x) max(x)-min(x), 0);

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 10 Jan. 2017
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);

Weitere Antworten (0)

Kategorien

Mehr zu Cell Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by