how do obtain sum of two rows
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Have a 18482 x 7 matrix. I want to obtain a matrix which contains the sum of row 1 and 2, row 3 and 4, etc until the last ones being the sum of row 18481 and 18482. How do I do this. Thanks in advance
0 commentaires
Réponses (2)
Walter Roberson
le 14 Déc 2017
output = YourMatrix(1:2:end, :) + YourMatrix(2:2:end, :);
2 commentaires
Rik
le 14 Déc 2017
That's what you get with ambivalent questions, there are multiple answers that fit the question.
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!