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?

 채택된 답변

Stephen23
Stephen23 2018년 1월 25일
편집: Stephen23 2018년 1월 25일

0 개 추천

You have a 1x1 cell containing a 5x1 cell, so all you need is this:
str2double(T{1}{5})

추가 답변 (1개)

Brittama
Brittama 2018년 1월 25일

0 개 추천

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.

카테고리

도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

질문:

2018년 1월 25일

댓글:

2018년 1월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by