Import large numbers from text file without scientific notation

I have a text file that contains some large numbers. when i import this file with importdata(file.txt) function, it will be in scientific notation.
how can i avoid this and import in full number in digit.

 채택된 답변

Walter Roberson
Walter Roberson 2019년 1월 21일
Don't use importdata then. Use textscan with %d64 for signed values or %u64 for unsigned values.
... But before you go to that trouble, give the command
format long g
and ask to display your data again. If your integer values are no more than +/- 999999999999999 then you will see the integer values.
If your integer value exceed 18446744073709551615 then you will not be able to store them exactly even as uint64.

댓글 수: 1

thansk a lot.it worked
format long
fileID = fopen(fileaddress);
C = textscan(fileID,'%u64');
fclose(fileID);
W = C{1};

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

madhan ravi
madhan ravi 2019년 1월 21일

0 개 추천

댓글 수: 1

it is not working. i use format long before importing data but still it is in scientific notation.

댓글을 달려면 로그인하십시오.

카테고리

질문:

2019년 1월 21일

댓글:

2019년 1월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by