Importing large files to double with a "." as a missing value
1 回表示 (過去 30 日間)
古いコメントを表示
Danielle Leblance
2016 年 11 月 20 日
コメント済み: Danielle Leblance
2016 年 11 月 20 日
I have many large files in excel . I am using the excel import function but the issue is that it shows all columns as cell columns because whenever there is a missing value the cell has a dot "." instead of nan or empty cell. Changing them manually is very tedious. Is there a way to force matlab to import all columns as vector columns while replacing the "." with a nan value?
2 件のコメント
Star Strider
2016 年 11 月 20 日
It would be much easier to give you a specific solution if we had your file (or a representative part of it) to work with.
採用された回答
Guillaume
2016 年 11 月 20 日
編集済み: Guillaume
2016 年 11 月 20 日
Nowadays, there's hardly any reason to use xlsread when readtable can also read excel files and is a lot more powerful.
In your particular case:
mytable = readtable('yourexcelfile.xlsx', 'TreatAsEmpty', '.')
will replace all the '.' by NaN.
edit: fixed typo
3 件のコメント
Guillaume
2016 年 11 月 20 日
That was a typo, the parameter was 'TreatAsEmpty'. Note that I did link the doc, so you could just have looked it up.
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Large Files and Big Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!