Hello everyone,
Does anyone know why I just get NaN as a result?
D=giuliayearlyDELTA2.Height;
E=str2double(D);
NEW_4=E *0.35 *10;
Thank you!

 採用された回答

Star Strider
Star Strider 2021 年 8 月 8 日

0 投票

There is one NaN value in ‘giuliayearlyDELTA2.Height’.
However, the str2double call is not necesary.
Just do:
D = giuliayearlyDELTA2.Height
NEW_4=D *0.35 *10;
.

2 件のコメント

Pul
Pul 2021 年 8 月 8 日
Thank you!
Star Strider
Star Strider 2021 年 8 月 8 日
As always, my pleasure!
.

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

その他の回答 (2 件)

KSSV
KSSV 2021 年 8 月 8 日

0 投票

D=giuliayearlyDELTA2.Height;
E=D;
NEW_4=E *0.35 *10;
D is not a string. You need not to ue str2double; already D is in double.
Ive J
Ive J 2021 年 8 月 8 日

0 投票

First, Height is already double, so
A = 2;
str2double(A)
ans = NaN
Secondly, first element of Height is NaN. Remove it prior to the analysis.

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

質問済み:

Pul
2021 年 8 月 8 日

コメント済み:

2021 年 8 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by