MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

# Solution 146015

Submitted on 9 Oct 2012 by Aurelien Queffurust

Correct

36Size
`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

```%%
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 x = your_fcn_name(x)
x=x(cell2mat(arrayfun(@(y) find(x==x(y),1,'first')==y, 1:length(x), 'UniformOutput', false)))
end
%This code written by profile_id 2391181
x =
9     2     5
```
2
Pass

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

```%%
x = rand(1,25);
assert(isequal(your_fcn_name(x),unique(x,'stable')))
```
```x =
Columns 1 through 6
0.7655    0.7952    0.1869    0.4898    0.4456    0.6463
Columns 7 through 12
0.7094    0.7547    0.2760    0.6797    0.6551    0.1626
Columns 13 through 18
0.1190    0.4984    0.9597    0.3404    0.5853    0.2238
Columns 19 through 24
0.7513    0.2551    0.5060    0.6991    0.8909    0.9593
Column 25
0.5472
```