Effacer les filtres
Effacer les filtres

How to get value from cell

181 vues (au cours des 30 derniers jours)
ly
ly le 19 Oct 2015
Modifié(e) : TastyPastry le 19 Oct 2015
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.

Réponse acceptée

TastyPastry
TastyPastry le 19 Oct 2015
Modifié(e) : TastyPastry le 19 Oct 2015
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.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 19 Oct 2015
str2double()

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by