How to alter the unimportable cells in the import wizard
Show older comments
I need to import a csv file of my data into matlab. My file has some missing data in it, which I can't do anything about. When I imported it, matlab automatically added a 0 to each missing cell, I need to change this to a NoData marker. I can click on the unimportable cells tab and then change it so that blank cells are replaced with ND instead of 0, but as soon as I click elsewhere it just changes back. How do I fix this?
1 Comment
Sean de Wolski
on 13 Feb 2013
It should be replacing with NaN by default (at least for numbers).
What does the data look like once it's imported? Can you show us a sample file and sample result?
Answers (1)
per isakson
on 13 Feb 2013
Edited: per isakson
on 13 Feb 2013
The function textscan has the property
EmptyValue, Value to return for empty numeric fields in delimited files. NaN
AFAIK: the import wizard does not provide this feature.
However, as Sean points out
1,,2,3
as a row in the text-file, returns
[ 1 nan 2 3 ]
Categories
Find more on Text Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!