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

10 ビュー (過去 30 日間)
Winston Black
Winston Black 2016 年 6 月 6 日
回答済み: Steven Lord 2016 年 6 月 6 日
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 Center および File ExchangeCell Arrays についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by