Cody

Problem 2768. Union of two set decreasing order

Solution 1558092

Submitted on 12 Jun 2018 by Jiahang Li
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x=[1 2 5]; y=[5 7 8]; y_correct = [8 7 5 2 1]; assert(isequal(unique_x(x,y),y_correct))

ans = 8 7 5 2 1

2   Pass
x=[1]; y=[1]; y_correct = [1]; assert(isequal(unique_x(x,y),y_correct))

ans = 1

3   Pass
x=[10]; y=[1]; y_correct = [10 1]; assert(isequal(unique_x(x,y),y_correct))

ans = 10 1

4   Pass
x=[1 5 8]; y=[2 4 6 4]; y_correct = [8 6 5 4 2 1]; assert(isequal(unique_x(x,y),y_correct))

ans = 8 6 5 4 2 1

Suggested Problems

More from this Author70

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!