Unique function of MATLAB--the uniqueness value of array matrix

Source: Internet
Author: User

Unique function of MATLAB--to find the uniqueness of array matrix

Related Mathwork documentation See this:unique values in a unique array

1 C = unique(A) . Returns the A same data as in, but does not contain duplicates. Chave been sorted by small to large.

2. C = unique(A,___,‘rows‘) and C = unique(A,‘rows‘,___) A each row in is treated as a single entity, and A the unique row in the sort order is returned. Must be specified A , setOrder and occurrence is optional.

‘rows‘option does not support cellular arrays.

3, you [C,ia,ic] = unique(___) can also use any of the above syntax to return the index vector ia and ic .

    • if  a   is a vector, then  c = A (ia)   and  a = C (IC) .

    • if  a   is a matrix or array, then  c = A (ia)   and  a (:) = C (IC) .

    • "rows"   option, then  c = A (ia,:)   and  a = C (IC,:) .

    • if  a   is a table or timesheet, then  c = A (ia,:)   and  a = C (IC,:) .

4. [C,ia,ic] = unique(A,‘legacy‘) ,

  [C,ia,ic] = unique(A,‘rows‘,‘legacy‘)

  [C,ia,ic] = unique(A,occurrence,‘legacy‘)And

  [C,ia,ic] = unique(A,‘rows‘,occurrence,‘legacy‘)Preserves the behavior of functions in r2012b and earlier versions unique .

‘legacy‘The option does not support categorical arrays, datetime arrays, duration arrays, tables, or timesheets.

Only IA and ICS are returned:

Unique function of MATLAB--the uniqueness value of array matrix

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.