How to fix an error from accumarray?

3 vues (au cours des 30 derniers jours)
Pradya Panyainkaew
Pradya Panyainkaew le 7 Fév 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

Réponse acceptée

Walter Roberson
Walter Roberson le 7 Fév 2018
A = accumarray(1+subs,val,[],@(x) {x})
  1 commentaire
Pradya Panyainkaew
Pradya Panyainkaew le 7 Fév 2018
thank you very much. Sir

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by