Command window version of "replace unimportable cells with..." ?

1 次查看(过去 30 天)
I am trying to import some data from a csv file of mixed data type (mostly numeric but one column is essentially datetime). Sometimes numeric columns will contain some NaN values, but they are recorded as NAN instead of NaN or nan which Matlab recognizes. I can import this data through uiimport using the option to replace unimportable cells with NaN. Is there a way to get this same functionality without having to interact with the ui using an import function (e.g., csvread,importdata, etc.)?

采纳的回答

Steven Lord
Steven Lord 2016-6-6
Open in the Import Tool one file that can serve as a template for the rest of the files to be imported. Set the options that you want to use to import the file then select Generate Function from the Import button (click the small triangle in the corner of the button.) The function that is generated will include a section that handles the unimportable data. Use that to process the data for the rest of the files you want to import.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Cell Arrays 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by