Filter löschen
Filter löschen

import data from numeric excel file e+08 NaN problem

2 Ansichten (letzte 30 Tage)
Jae Heon Kim
Jae Heon Kim am 6 Mär. 2020
Kommentiert: Jae Heon Kim am 13 Mär. 2020
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 Kommentare
Ameer Hamza
Ameer Hamza am 6 Mär. 2020
Can you provide a sample excel file? I will help in suggesting a solution to read data properly.
Guillaume
Guillaume am 6 Mär. 2020
"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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

darova
darova am 6 Mär. 2020
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 Kommentar
Jae Heon Kim
Jae Heon Kim am 13 Mär. 2020
Well I found that one of my fellow made a mistake to write down the formats. Now It's solved! :D

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by