Cody

Solution 854550

Submitted on 22 Mar 2016 by LY Cao
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
filetext = fileread('your_fcn_name.m') assert(isempty(strfind(filetext, 'unique'))) assert(isempty(strfind(filetext, 'stable'))) A = [9 2 9 5]; assert(isequal(your_fcn_name(A),unique(A,'stable')))

filetext = function y = your_fcn_name(x) y = setdiff(x,'','Stable') end %This code written by profile_id 3021298 y = 9 2 5

2   Pass
x = [42 1 1 1 42 17 17]; assert(isequal(your_fcn_name(x),unique(x,'stable')))

y = 42 1 17

3   Pass
x = rand(1,25); assert(isequal(your_fcn_name(x),unique(x,'stable')))

y = Columns 1 through 9 0.9012 0.8773 0.2546 0.2602 0.8482 0.8675 0.6951 0.2708 0.4231 Columns 10 through 18 0.3602 0.0993 0.4723 0.9951 0.2710 0.6899 0.3992 0.6488 0.2137 Columns 19 through 25 0.9230 0.0285 0.0821 0.1461 0.2035 0.4607 0.2535