| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Statistics Toolbox |
| Contents | Index |
| Learn more about Statistics Toolbox |
Unique values in categorical array
B = unique(A)
[B,I,J] = unique(A)
[B,I,J] = unique(A,'first')
B = unique(A) returns a categorical array containing the unique elements of A, sorted by the order of A's levels.
[B,I,J] = unique(A) also returns index vectors I and J such that B = A(I) and A = B(J).
[B,I,J] = unique(A,'first') returns the vector I to index the first occurrence of each unique value in A. unique(A,'last'), the default, returns the vector I to index the last occurrence.
intersect, ismember, setdiff, setxor, union
![]() | union (categorical) | unstack (dataset) | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |