Summin elements on the rows of a specific page of a matrix
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
kevin cecere palazzo
am 30 Jul. 2019
Beantwortet: Guillaume
am 30 Jul. 2019
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 Kommentare
Akzeptierte Antwort
Guillaume
am 30 Jul. 2019
B = sum(A(:, :, 1), 2); %sum 1st page of A across the columns (across the 2nd dimension)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!