How to delete specific text from multiple cell in a column ?

2 ビュー (過去 30 日間)
Cristian Martin
Cristian Martin 2020 年 6 月 13 日
コメント済み: Cristian Martin 2020 年 6 月 13 日
Hi!
I have the following column :
21.15 (cd)
42.12 (cd)
24.45 (cd)
..............
It must show like this, without brackets and text :
21.15
42.12
24.45
..............
Thanks in advance guys !

採用された回答

madhan ravi
madhan ravi 2020 年 6 月 13 日
編集済み: madhan ravi 2020 年 6 月 13 日
c = {'21.15 (cd)';...
'42.12 (cd)';...
'24.45 (cd)'};
func = @(x) sscanf(c{x},'%f');
Wanted = arrayfun(func,1:numel(c)).'
  1 件のコメント
Cristian Martin
Cristian Martin 2020 年 6 月 13 日
Hi Ravi, for my matrix I will have allways each time a different string of numbers, only text in brackets will be the same, so I need something that will scan and erase only text...Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by