column wise adding
Afficher commentaires plus anciens
i had y= 1 6 4 7 5 3 6 4 9 n so on... i want yout=1+6+4 7+5+3 6+4+9
Réponses (1)
Andrei Bobrov
le 8 Juin 2011
doc reshape
doc sum
yout = sum(reshape(y,3,[]));
EDIT
z = sum((x-y).^2,2);
2 commentaires
mahaveer hanuman
le 8 Juin 2011
David Young
le 8 Juin 2011
y(0) = 1 2 5 does not make sense. First because MATLAB array indexes start from 1; second because if y is a numerical array each element must contain a single value, not 3 values. Please can you clarify what you want to do?
Catégories
En savoir plus sur Operators and Elementary Operations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!