필터 지우기
필터 지우기

import data from numeric excel file e+08 NaN problem

조회 수: 2 (최근 30일)
Jae Heon Kim
Jae Heon Kim 2020년 3월 6일
댓글: Jae Heon Kim 2020년 3월 13일
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