MATLAB Answers

0

extracting only numeric part from cell array includes character and number

Asked by sermet on 24 May 2017
Latest activity Answered by ES
on 24 May 2017
data=
'0.0253906'
'0.0292969'
'0.03125</'
'0.03125</'
'0.03125</'
'0.0058593'
'0.03125</'
'0.0117188'
'0.0117188'
'0.0234375'
data= 10x1 cell
I need to extract only numeric parts of each row of data. "</" characters of 3-5 and 7th rows need to be removed.

  0 Comments

Sign in to comment.

1 Answer

Answer by ES
on 24 May 2017
 Accepted Answer

You can use regular expressions on this to filter out data you need. Example
a = regexp(data,'[0-9]+.[0-9]+', 'match')%all numbers of format xyz.abc

  0 Comments

Sign in to comment.