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

Correct

20Size
Leading solution size is 13.
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
Pass
 
%%
x = [208    40   167   180   112    70   192   215    90    19
     231   100     9   100    97   100    65   100   100   100
     32   245   100    70   195   167   129   208   149   135
     233   124   239   100   203    41   178    62   140   199
     161   204   173    24   100    30   228   237   234   239
     24    36   193   210   125   127   245    89    73    33
     71   107   190   177   114   245   140   100   193   145
     140   100   100    81   165    87    35    64   192   120
     245   202   167   100   181   149    38   157   100   100
     100   245   100   100   193   100   100   121   145    86];
y_correct = [208    40   167   180   112    70   192   215    90    19
            231     0     9     0    97     0    65     0     0     0
            32   245     0    70   195   167   129   208   149   135
            233   124   239     0   203    41   178    62   140   199
            161   204   173    24     0    30   228   237   234   239
            24    36   193   210   125   127   245    89    73    33
            71   107   190   177   114   245   140     0   193   145
            140     0     0    81   165    87    35    64   192   120
            245   202   167     0   181   149    38   157     0     0
            0   245     0     0   193     0     0   121   145    86];
assert(isequal(Find_And_Replace(x),y_correct))
tic
Find_And_Replace(x);
t = toc;
display(t);
t =
   1.4800e-04