ho to get rid of repeated cells in cells arrays functions
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello..
I have a cells array as follows:
contextt =
{24x1 cell} {25x1 cell} {26x1 cell}
I need to find the repeated cells in each column of the cells..
I used the following code , but doesn't help
[~,idx]=unique(cell2mat(contextt),'rows');
context_arr=contextt(idx,:)
with the following error:
Cannot support cell arrays containing cell arrays or objects
I changed the command 'rows' to 'columns' in the secod fucntion , but also doesn't work... also I want to results to be shown for the cells array contextt any advice Regards
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2012년 11월 22일
편집: Azzi Abdelmalek
2012년 11월 22일
contextt={{1 2 3 4},{1 1 2 5},{2 2 2 6 7}}
out=cellfun(@(x) unique(cell2mat(x)),contextt,'un',0)
댓글 수: 7
Jan
2012년 11월 22일
@Jwana: Accepting an answer means that it solves your problem. Is the problem solved already?
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!