MATLAB Answers

0

xlsread: NaN is not recognized as Numeric Data

Asked by chris_andreas on 23 Jun 2016
Latest activity Answered by chris_andreas on 4 Jul 2016
I like to import data from the file 'test.csv' (see attachment) into matlab. I use following code:
[Data, Time] = xlsread('test.csv')
Problem: The numeric data that is returned doesn't include the NaN data from the first rows. It looks like that xlsread doesn't include the NaN data if the whole row consists only of NaN Data. For my routine the NaN data from the first rows needs to be returned also.
Thx for your help. Chris

  0 Comments

Sign in to comment.

Tags

3 Answers

Answer by chris_andreas on 4 Jul 2016
 Accepted Answer

Hi! I found a solution: With the function "importdata" the data is imported the "right" way.

  0 Comments

Sign in to comment.


Answer by dpb
on 23 Jun 2016

My release of Excel doesn't have NaN as a numeric entity; suspect it's not being returned because it isn't numeric. Look at the alternate outputs of xlsread, text, and raw. You'll likely have to process the raw text array.

  0 Comments

Sign in to comment.


Answer by Muhammad Usman Saleem on 23 Jun 2016

convert this csv file into excel. Then try to read
xlsread('test.csv')
or you have another option if NAN values are not read by xlsread. Change in csv file NaN value with arbitary value like -999999 then try to read them. After then you can change this value with NaN as
find(data=-999999)=nan;
tell me please

  0 Comments

Sign in to comment.