How to get value from cell

188 次查看(过去 30 天)
ly
ly 2015-10-19
编辑: TastyPastry 2015-10-19
I have a cell like this:
...
'ITEM:'
'0'
'ITEM:'
'75'
'ITEM:'
'-0.0001174'
'2.1593e-005'
'-10'
'ITEM:'
'167'
'216'
'215'
'268'
'269'
...
I want to get value from '167' to '269' in number (NOT in string) Which command can be used? Give the code is helpful.

采纳的回答

TastyPastry
TastyPastry 2015-10-19
编辑:TastyPastry 2015-10-19
str2double(myCell{index});
index is whatever index the data you need to convert is. If you need to run this command on all cells (looping or something of that sort), you'll need to be aware that str2double() returns NaN for strings which are either non-numeric or are multiple numbers.

更多回答(1 个)

Walter Roberson
Walter Roberson 2015-10-19
str2double()

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by