Why do I get NaN?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Pul
am 8 Aug. 2021
Kommentiert: Star Strider
am 8 Aug. 2021
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!
0 Kommentare
Akzeptierte Antwort
Star Strider
am 8 Aug. 2021
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 Kommentare
Weitere Antworten (2)
KSSV
am 8 Aug. 2021
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.
0 Kommentare
Ive J
am 8 Aug. 2021
First, Height is already double, so
A = 2;
str2double(A)
Secondly, first element of Height is NaN. Remove it prior to the analysis.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!