Reading a data starting with zeros

1 回表示 (過去 30 日間)
Hamza
Hamza 2013 年 2 月 16 日
Dear members
I have the following data from a text file:
1 23948U 96040A 96214.98321868 .00000118 00000-0 00000+0 0 464
2 23948 0.0614 236.9184 0001375 279.5530 174.2840 1.00271670 256
In line 2 the term '0001375' I want to read it as '0.0001375' but actually when I read this term it is read as '1375'.
Any solution to this?
I am using the following code to read it.
ecc=str2double(L2(5)); %L2 is line 2 (I have split the lines as L1 and L2)
  2 件のコメント
Image Analyst
Image Analyst 2013 年 2 月 16 日
Why is it wrong in the first place? What wrote out this incorrect data? Can you fix it there so it doesn't get written out incorrectly in the first place? Also, what do you want to do with terms that have letters (U, A like line #1) attached to them?
Hamza
Hamza 2013 年 2 月 17 日
Actually it is a TLE (Two Line Element) Data. And it comes as it is. I have a huge data to be read therefore I needed a way to read them in a desired way. The term I am referring to is eccentricity of the orbit. More info at http://www.celestrak.com/NORAD/documentation/tle-fmt.asp

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

採用された回答

Walter Roberson
Walter Roberson 2013 年 2 月 16 日
ecc=str2double( ['0.' L2{5}]);
  3 件のコメント
Walter Roberson
Walter Roberson 2013 年 2 月 16 日
str2double(strcat('0.', L2(:,5)))
Hamza
Hamza 2013 年 2 月 17 日
Thanks a lot

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by