import data from numeric excel file e+08 NaN problem

2 次查看(过去 30 天)
I am trying to import excel data into matlab.
Well, we all know that we can do it by just clicking 'import data' or using other functions.
Btw, problem is one of the row, the whole number are to long just like this. "2.21911e+087251.96"
So when I checked output type as numeric table, the numbers of this row are replaced into NaN.
But when I selected table, at least the row saved as Text type.
You might say that change the type text into Numbers(double). It also NaN
I want to solve this problem and these are the ways I tried.
% Ouput Type Table named "Untitled"
% # 1
temp = table2array(Untitled); % now it's turned to str array
tempNum = str2num(temp); % Error using str2num Input must be a character vector or string scalar
% # 2
temp2 = Untitled{:,:}; % now it's turned to str array
str2double(temp2); % it worked but still "2.21911e+087251.96" row changed into "NaN"
% # 3
temp3 = table2cell(Untitled); % cell type
blahblahblah
% anyway also not worked
% Can you people help me? X(
  2 个评论
Ameer Hamza
Ameer Hamza 2020-3-6
Can you provide a sample excel file? I will help in suggesting a solution to read data properly.
Guillaume
Guillaume 2020-3-6
"whole number are to long just like this. 2.21911e+087251.96"
2.21911e+087251.96
is not a valid number notation, in excel, matlab or mathematically, so what number should that be?
You either need to explain how that expression should be interpreted or go back to whatever generated that expression and fix it so it outputs valid numbers.

请先登录,再进行评论。

采纳的回答

darova
darova 2020-3-6
Boundaries of double precision
>> realmin
ans =
2.2251e-308
>> realmax
ans =
1.7977e+308
But you have 2.21911e+087251.96
There is no float number for exponent
>> 2E1
ans =
20
>> 2E1.1
2E1.1
|
Error: Unexpected MATLAB expression.
  1 个评论
Jae Heon Kim
Jae Heon Kim 2020-3-13
Well I found that one of my fellow made a mistake to write down the formats. Now It's solved! :D

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by