Cody

Problem 1237. It's race time! Write a faster function than the test suite call of unique().

Write a function to get unique elements of a vector faster than unique()! Input will be a vector (of integers or floating point numbers) of any size. The order of the returned vector is unimportant.

Example: Input: x = [1 1 2 2 3 3]; Output: [1 2 3];

Input: x = [0.1 3.1 2.1 2.0 3.1]; Output: [0.1 3.1 2.1 2.0]; % or any order

Solution Stats

34.07% Correct | 65.93% Incorrect
Last solution submitted on Aug 26, 2016

Problem Comments

Solution Comments

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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more