how do obtain sum of two rows
조회 수: 10 (최근 30일)
이전 댓글 표시
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
답변 (2개)
Walter Roberson
2017년 12월 14일
output = YourMatrix(1:2:end, :) + YourMatrix(2:2:end, :);
댓글 수: 2
Rik
2017년 12월 14일
That's what you get with ambivalent questions, there are multiple answers that fit the question.
참고 항목
카테고리
Help Center 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!