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

조회 수: 1 (최근 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 CenterFile Exchange에서 Text Data Preparation에 대해 자세히 알아보기

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by