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 日
str2double(T{1}{5})
ans =
100.7000
Thank you!!!

サインインしてコメントする。

その他の回答 (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