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 395630

Submitted on 3 Feb 2014 by Selvaraaju Murugesan

Correct

30Size
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
 
%%
a = [9 9 9 9 9 97 7 76 6 6 5 54 2 1];
       b = [1 1 13 3 3 44 4 10 110];
y_correct = [9 97 7 76 6 5 54 2 1 13 3 44 4 10 110];
assert(isequal(union_without_repitition(a,b),y_correct))
ans =
     9    97     7    76     6     5    54     2     1    13     3    44     4    10   110
2
Pass
 
%%
a = [96 6 65 54 2 1];
       b = [1 13 3 3 3 44 4 4 410 10 10];
 y_correct =[96 6 65 54 2 1 13 3 44 4 410 10];
assert(isequal(union_without_repitition(a,b),y_correct))
ans =
    96     6    65    54     2     1    13     3    44     4   410    10