extracting only numeric part from cell array includes character and number
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
ES
2017-5-24
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!