I have a cell T =
cell
{5×1 cell}
and would like to extract the last item ('100.7') in this cell and convert to number (str2num) T{:}
ans =
5×1 cell array
'#'
'Ambient'
'pressure'
':'
'100.700'
Any tips?

 Respuesta aceptada

Stephen23
Stephen23 el 25 de En. de 2018
Editada: Stephen23 el 25 de En. de 2018
You have a 1x1 cell containing a 5x1 cell, so all you need is this:
str2double(T{1}{5})

Más respuestas (1)

Brittama
Brittama el 25 de En. de 2018
sorry did not work...
K>> str2double(T{5}) Index exceeds matrix dimensions.
K>> T
T =
cell
{5×1 cell}
K>> T{5} Index exceeds matrix dimensions.
K>> T{5,1} Index exceeds matrix dimensions.

Categorías

Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 25 de En. de 2018

Comentada:

el 25 de En. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by