| Author |
Function to get only the different values of an array.
|
|
| Diego Gomes 2007-06-29, 7:14 pm |
| Hello,
I would like to know if there is a function that returns me only the
different values of an array. For example:
Imagine we have the following array:
a = (1 2 3 2 3 4 6 3 4)
I want to know if MatLab has a function that returns me the following
array:
result = (1 2 3 4 6)
The function is like the "SELECT DISTINCT" command of SQL.
Thanks.
| |
|
| Diego Gomes:
<SNIP a matter of english...
> I would like to know if there is a function that returns me only
the different values of an array...
a hint:
help unique;
us
| |
| Diego Gomes 2007-06-29, 7:14 pm |
| I tried the MatLab help but I couldn't find. Do you know if exists?
| |
|
| Diego Gomes:
<SNIP cannot fine <unique>(?)...
> Do you know if exists...
it's part of ML's basic toolbox
% try
which unique
us
| |
| Diego Gomes 2007-06-29, 7:14 pm |
| It worked, thank you very much.
|
|
|
|