필터 지우기
필터 지우기

How to sum two rows at a time in matrix

조회 수: 2 (최근 30일)
Vishal Sharma
Vishal Sharma 2017년 6월 19일
답변: Adam 2017년 6월 19일
I have a matrix of size 6 by 3
A = [1 2 3; 3 4 5; 4 5 6; 5 4 3; 3 4 3; 3 2 1]
I want to make sum of two rows at a time, so as to get result
[18; 27; 16]

채택된 답변

Adam
Adam 2017년 6월 19일
sum( reshape( A', 6, 3 ) )

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by