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

조회 수: 4 (최근 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 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