Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 196440

Submitted on 25 Jan 2013

Incorrect

18Size
Leading solution size is 15.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Fail
 
%%
A = 127*ones(5,4)
B_correct = [56 85 85 56; 85 127 127 85; 85 127 127 85; 85 127 127 85; 56 85 85 56]
assert(isequal(med_filt(A),B_correct))
clear all
Error: Undefined function 'imfilter' for input arguments of type 'double'.
2
Fail
 
%%
A(1,:) = [0:7:63];
A(2,:) = [63:7:127];
A(3,:) = [128:7:191];
A(4,:) = [192:7:256];
A
B_correct = [16 26 30 35 40 44 49 54 58 40; 45 71 78 85 92 99 106 113 120 82; 87 135 142 149 156 163 170 177 184 125; 73 111 116 121 125 130 135 139 144 98]
assert(isequal(med_filt(A),B_correct))
Error: Undefined function 'imfilter' for input arguments of type 'double'.
3
Fail
 
%%
clear all
A = [71 128 192 246 215; 174 246 65 140 65; 168 87 130 35 208; 42 150 179 38 62; 30 57 228 66 238]
B_correct = [69 97 113 103 74; 97 140 141 144 101; 96 138 119 102 61; 59 119 108 132 72; 31 76 80 90 45]
assert(isequal(med_filt(A),B_correct))
Error: Undefined function 'imfilter' for input arguments of type 'double'.