필터 지우기
필터 지우기

Checking duplicateentries in a large matrix

조회 수: 1 (최근 30일)
Muhammad Shaikh
Muhammad Shaikh 2013년 4월 11일
Hi all,
I have a very large matrix (901x1801) which I generated by combining values of three similar arrays (with repeated values in them) to generate unique codes using a mathematical expression. The matrix is filled with these codes.
My question is*...* How can I check that each values of the matrix (901x1801) is unique and not repeating even a single time?
Or... Can anyone tell me how can I generate a matrix by combining three arrays of similar elements in a way that each generated value will be unique.
an early reply will be greatly appreciated. Thanks in advance.

답변 (1개)

Mahdi
Mahdi 2013년 4월 11일
I would recommend looking at the unique() function in MATLAB.
In your case, it seems that you want to have unique values, so it would basically be
Matrix2=unique(Matrix1)
This would generate Matrix2 with unique, non-repeating values, and sorts them in increasing order.
  댓글 수: 1
Mahdi
Mahdi 2013년 4월 11일
You can also use [C, C1, A1]=unique(Matrix1) to get where these values are. Look at the link for unique that I posted for more variations.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by