필터 지우기
필터 지우기

Unique (partial) values

조회 수: 1 (최근 30일)
Mario
Mario 2017년 9월 30일
댓글: Mario 2017년 9월 30일
Hi all! I have a cell array (imported by xlsread) of this kind:
'0.000000000' '185.47.162.26'
'0.000658000' '185.47.169.249'
'0.000793000' '177.10.146.49'
'0.003146000' '185.47.162.26'
'0.006683000' '185.47.162.26'
Now...i'm interested to select only rows corresponding to the first unique values of second column. So...in this example i need the following output:
'0.000000000' '185.47.162.26'
'0.000658000' '185.47.169.249'
'0.000793000' '177.10.146.49'
Unique function seems not to support a feature like this. Can you help me? Thx in advance! Mario

답변 (1개)

Walter Roberson
Walter Roberson 2017년 9월 30일
[~, idx] = unique(YourCellArray(:,2), 'stable');
output = YourCellArray(idx, :);
  댓글 수: 1
Mario
Mario 2017년 9월 30일
thank you!!!

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by