Cody

# Problem 980. Unique values without using UNIQUE function

Solution 1976430

Submitted on 14 Oct 2019 by Earnest
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 = []; while numel(x) > 0 y(end+1) = x(1); x(x==x(1)) = []; end y end %This code written by profile_id 15921379 ' 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 18 0.7705 0.3089 0.7173 0.1307 0.0644 0.1098 0.7863 0.8537 0.7890 0.1545 0.5499 0.3481 0.8928 0.5944 0.3050 0.8016 0.6539 0.0962 Columns 19 through 25 0.9750 0.7720 0.6426 0.5806 0.7440 0.7481 0.6178