フィルターのクリア

how I can finish randomly repeated values in a matrix

2 ビュー (過去 30 日間)
Ghulam Murtaza
Ghulam Murtaza 2016 年 10 月 14 日
コメント済み: Image Analyst 2016 年 10 月 15 日
Hi I have a matrix
A=[1 0;
1 3;
2 8;
2 3;
1 8;
5 6;
6 5;
5 9;
6 9]
, how I can end up repeated values in column one no matter if values repeat in column two. Please help me I am new and not know to much about matlab.
  3 件のコメント
Ghulam Murtaza
Ghulam Murtaza 2016 年 10 月 15 日
I mean how we finish those values which are repeated in column one and get new matrix in which column one has no repeated values
Image Analyst
Image Analyst 2016 年 10 月 15 日
What does "finish" mean? Why is the original array unfinished or partial??? What do you need to add to it to "finish" it? Please show what you'd like as an output array to eliminate any uncertainty in what you want.

サインインしてコメントする。

採用された回答

KSSV
KSSV 2016 年 10 月 14 日
[C,ia,ib]=unique(A(:,1));
doc unique
  2 件のコメント
Ghulam Murtaza
Ghulam Murtaza 2016 年 10 月 15 日
This does not give me answer according to my requirements, I want to know how i get remaining matrix when repeated values vanish i.e. how I get like this A=[1 0; 1 3; 2 8; 5 6; 6 9]. Now repeated values are vanished please help in this way. thanks in advance.
KSSV
KSSV 2016 年 10 月 15 日
Read about unique...it will give you what you want.
[C,ia,ib]=unique(A(:,1));
iwant = A(ia,:);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by