How to remove character in table

2 ビュー (過去 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 Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by