Filter löschen
Filter löschen

How to fix an error from accumarray?

1 Ansicht (letzte 30 Tage)
Pradya Panyainkaew
Pradya Panyainkaew am 7 Feb. 2018
I have val and subs variables as I shown you and I try to group subs values into same cell array asnd return val to me. When I run this code
A = accumarray(subs,val,[],@(x) {x})
the Matlab software shows this error "Error using accumarray First input SUBS must contain positive integer subscripts.". Thus, I want to know how can I fix it out ?
Thanks in advance

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 7 Feb. 2018
A = accumarray(1+subs,val,[],@(x) {x})

Weitere Antworten (0)

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by