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

16Size
This is the leading solution.
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
 
%%
vec = [ 10 2 3 89 5 7 90 0 12];
vNotch= [90 89 12 10 7 5 3 2 0 0 2 3 5 7 10 12 89 90];
assert(isequal(vNotchVector(vec),vNotch))
ans =
  Columns 1 through 16
    90    89    12    10     7     5     3     2     0     0     2     3     5     7    10    12
  Columns 17 through 18
    89    90
2
Pass
 
%%
vec = [ -8 -7 -6 -5 0 3 67 100 100 400];
vNotch= [400 100 100 67 3 0 -5 -6 -7 -8 -8 -7 -6 -5 0 3 67 100 100 400];
assert(isequal(vNotchVector(vec),vNotch))
ans =
  Columns 1 through 16
   400   100   100    67     3     0    -5    -6    -7    -8    -8    -7    -6    -5     0     3
  Columns 17 through 20
    67   100   100   400
3
Pass
 
%%
vec= [1 0 1 0 1 0 1 0 1 0 1 0];
vNotch = [1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1  1 1 1 1 1];
assert(isequal(vNotchVector(vec),vNotch))
ans =
  Columns 1 through 16
     1     1     1     1     1     1     0     0     0     0     0     0     0     0     0     0
  Columns 17 through 24
     0     0     1     1     1     1     1     1