Cody

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

Solution 1265012

Submitted on 8 Sep 2017 by goc3
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));

m = 31.7000

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));

m = 29.8750

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));

m = 8.4000

Suggested Problems

More from this Author2

Community Treasure Hunt

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

Start Hunting!