Why am I getting select cells with NaN when I import my data?

1 回表示 (過去 30 日間)
Josh Hershman
Josh Hershman 2018 年 3 月 26 日
回答済み: Walter Roberson 2018 年 3 月 26 日
I'm trying to import a 73x2 table from a .txt file into Matlab. Everything in the first column shows up correctly in the preview before I import, however, there are issues with the second column. 16 out of the 73 elements are replaced by NaN, scattered (seemingly randomly) throughout. The .txt file I have the data in simply has the two numbers, separated with a space, followed by a semicolon after the second number. I tried to look for a relation between the cells that didn't get properly imported (IE, the length of the number), but there wasn't one.
  3 件のコメント
KSSV
KSSV 2018 年 3 月 26 日
Show us your code and attach your text file....
Josh Hershman
Josh Hershman 2018 年 3 月 26 日
My apologies, I've edited my original post to include the .txt file.

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

採用された回答

Walter Roberson
Walter Roberson 2018 年 3 月 26 日
data = load('bananas.txt');
seems to do fine.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by