Ajith Bharadwaj
Followers: 0 Following: 0
Statistics
All
RANK
240,379
of 289,758
REPUTATION
0
CONTRIBUTIONS
0 Questions
1 Answer
ANSWER ACCEPTANCE
0.00%
VOTES RECEIVED
0
RANK
of 19,583
REPUTATION
N/A
AVERAGE RATING
0.00
CONTRIBUTIONS
0 Files
DOWNLOADS
0
ALL TIME DOWNLOADS
0
CONTRIBUTIONS
0 Posts
CONTRIBUTIONS
0 Public Channels
AVERAGE RATING
CONTRIBUTIONS
0 Highlights
AVERAGE NO. OF LIKES
Feeds
Answered
Write a function called halfsum that takes as input an at most two-dimensional matrix A and computes the sum of the elements of A that are in the diagonal or are to the right of it. example, the input is [1 2 3; 4 5 6; 7 8 9],the ans is 26
function summa = halfsum(A) [row col] = size(A); for ii = 1:row for jj = ii:col summa = summa + A(ii,jj); end end
Write a function called halfsum that takes as input an at most two-dimensional matrix A and computes the sum of the elements of A that are in the diagonal or are to the right of it. example, the input is [1 2 3; 4 5 6; 7 8 9],the ans is 26
function summa = halfsum(A) [row col] = size(A); for ii = 1:row for jj = ii:col summa = summa + A(ii,jj); end end
4 years ago | 0