Borrar filtros
Borrar filtros

import data from numeric excel file e+08 NaN problem

2 visualizaciones (últimos 30 días)
Jae Heon Kim
Jae Heon Kim el 6 de Mzo. de 2020
Comentada: Jae Heon Kim el 13 de Mzo. de 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 comentarios
Ameer Hamza
Ameer Hamza el 6 de Mzo. de 2020
Can you provide a sample excel file? I will help in suggesting a solution to read data properly.
Guillaume
Guillaume el 6 de Mzo. de 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.

Iniciar sesión para comentar.

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Import from MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by