adding elements of an array column wise and storing it in different array
조회 수: 18 (최근 30일)
이전 댓글 표시
delay consists of some rows and columns.How to add its elements column wise and store it in another array with rows as earlier and column is 1
댓글 수: 0
답변 (1개)
Shivam Chaturvedi
2015년 12월 8일
편집: Shivam Chaturvedi
2015년 12월 8일
You can use the sum function ( Sum of Array Elements [link to doc page] ) and since you need to sum on the columns, you can specify the dim parameter (should be 2 in this case to sum up column wise).
columnwise = sum(arr,2) % will get the columns summed up. Result will be 1 column.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!