필터 지우기
필터 지우기

Importing Excel-Spreadsheet with columns of NaN

조회 수: 3 (최근 30일)
kanimbla
kanimbla 2014년 3월 12일
댓글: nl2605 2014년 3월 12일
Hi,
I have a large dataset in an Excel-Spreadsheet which contains some columns with only NaN. The first row of the spreadsheet contains the column names (strings).
I would like to find the column names that are associated with NaN-columns. Is there a way to do this?
Thanks!

답변 (1개)

nl2605
nl2605 2014년 3월 12일
Use xlsread. [num,txt,raw] = xlsread('filename.xlsx'); and then check with 'isnan' to get the corresponding column name.
  댓글 수: 2
kanimbla
kanimbla 2014년 3월 12일
The problem is that xlsread does not read columns which contain only NaN.
I want to identify the names of the columns which contain only NaN (not the column names which contain both numeric values and NaN).
nl2605
nl2605 2014년 3월 12일
Yea, I checked it now. It seems it reads it as text and not a number which is what NaN is all about. Why don't use strcmp then? and read the txt and num columns and check.

댓글을 달려면 로그인하십시오.

카테고리

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