필터 지우기
필터 지우기

Summin elements on the rows of a specific page of a matrix

조회 수: 1 (최근 30일)
kevin cecere palazzo
kevin cecere palazzo 2019년 7월 30일
답변: Guillaume 2019년 7월 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?

채택된 답변

Guillaume
Guillaume 2019년 7월 30일
B = sum(A(:, :, 1), 2); %sum 1st page of A across the columns (across the 2nd dimension)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by