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 Exchange에서 Data 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