Cody

# Problem 44279. Find the mean of a 2-D matrix after excluding elements of specified sub-matrix

Solution 2117534

Submitted on 4 Feb 2020 by Asif Newaz
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
Ax = [1 2 3 4 5 6; 11 12 13 14 15 16; 21 22 23 24 25 26; 31 32 33 34 35 36; 41 42 43 44 45 46; 51 52 53 54 55 56]; r1x = 0; r2x = 4; c1x = 1; c2x = 4; y_correct = 31.7; assert(isequal(mean2d_excl(Ax,r1x,r2x,c1x,c2x),y_correct));

b = 1 11 21 31 41 51 32 42 52 33 43 53 4 14 24 34 44 54 5 15 25 35 45 55 6 16 26 36 46 56

2   Pass
Ax = [1 2 3 4 5 6; 11 12 13 14 15 16; 21 22 23 24 25 26; 31 32 33 34 35 36; 41 42 43 44 45 46; 51 52 53 54 55 56]; r1x = 1; r2x = 4; c1x = 1; c2x = 4; y_correct = 29.875; assert(isequal(mean2d_excl(Ax,r1x,r2x,c1x,c2x),y_correct));

b = 1 11 21 31 41 51 2 32 42 52 3 33 43 53 4 14 24 34 44 54 5 15 25 35 45 55 6 16 26 36 46 56

3   Pass
Ax = [1 2 3 ; 12 13 14; 24 25 26]; r1x = 1; r2x = 4; c1x = 1; c2x = 4; y_correct = 8.4; assert(isequal(mean2d_excl(Ax,r1x,r2x,c1x,c2x),y_correct));

b = 1 12 24 2 3