photo

Prashanth Reddy Penta Reddy


Active since 2017

Followers: 0   Following: 0

Statistics

  • First Answer

View badges

Feeds

View by

Answered
Write a function called halfsum that takes as input an at most two-dimensional array A and computes the sum of the elements of A that are in the lower right triangular part of A
function u = halfsum(P) u1 = P(end:-1:1, 1:end); u2 = triu(u1); u = sum(u2(:)); end

ongeveer 7 jaar ago | 2