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 16.
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))

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

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