필터 지우기
필터 지우기

Unique Rows in Cell Array

조회 수: 2 (최근 30일)
RDG
RDG 2013년 4월 2일
Suppose my problem requires me to use a cell array and the content is as such: (Please forgive my bad coding method. I just want to illustrate the problem)
a=cell(2,1)
a{1}=[1 1 1 1;1 1 1 1;2 3 2 3;2 3 2 3;2 4 2 1;]
a{2}=[4 5 6 7;4 5 6 7;2 3 4 5;2 3 4 5;1 2 3 4;]
How can I find the occurrence of duplicate values for each row in each cell array? (Since conventional unique function cannot be applied on cell array contents)

채택된 답변

José-Luis
José-Luis 2013년 4월 2일
my_unik = cellfun(@(x) unique(x,'rows'),a,'uniformoutput',false);
Or what is it you want?
  댓글 수: 1
RDG
RDG 2013년 4월 2일
Thank you. I can work around the code. I tried cellfun earlier but I didn't really understand how to play around with it. Thanks for the tip!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by