Summin elements on the rows of a specific page of a matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
If I have a matrix A(n,m,2) i.e. a two pages matrix, and a vector B(n,1), how should I write the expression for the j-th element of b, if I want B to contain the sum of the elements of the rows of the first page of A?
댓글 수: 0
채택된 답변
Guillaume
2019년 7월 30일
B = sum(A(:, :, 1), 2); %sum 1st page of A across the columns (across the 2nd dimension)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!