How to remove character in table

조회 수: 4 (최근 30일)
Light.16
Light.16 2017년 1월 31일
댓글: Andrei Bobrov 2017년 1월 31일
Hello guys !
(Sorry 4 my english)
I'm trying to remove character in a table that contains some genome sequences (cell vector)... In particular i have:
A = {'T'; 'G'; 'A'; 'TT'; 'TGAT'; 'G'};
My intention is to delete all the rows that contain MORE than one letter.. so the rows 'TT' and 'TGAT' must be deleted.
Can you help me please? Is there some particular function that i can use?
Ty so much

채택된 답변

KSSV
KSSV 2017년 1월 31일
A = {'T'; 'G'; 'A'; 'TT'; 'TGAT'; 'G'};
l = cell2mat(cellfun(@length,A,'un',0)) ;
A(l>1) = []

추가 답변 (1개)

Andrei Bobrov
Andrei Bobrov 2017년 1월 31일
out = A(cellfun(@numel,A) == 1)
  댓글 수: 2
Light.16
Light.16 2017년 1월 31일
really thanks you !! unfortunately I can not accept more than one answer..
Andrei Bobrov
Andrei Bobrov 2017년 1월 31일
:)

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

카테고리

Help CenterFile Exchange에서 Genomics and Next Generation Sequencing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by