Find indices in accumarray syntax

1 visualización (últimos 30 días)
Oday Shahadh
Oday Shahadh el 10 de En. de 2017
Comentada: Oday Shahadh el 10 de En. de 2017
How can I find the indices in the accumarray syntax below, Thanks in advance
accumarray(OrbNO,elev,[],@(x) max(x)-min(x), 0);

Respuesta aceptada

Walter Roberson
Walter Roberson el 10 de En. de 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);

Más respuestas (0)

Categorías

Más información sobre Cell Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by