dlmread result different from load

조회 수: 1 (최근 30일)
Yu Li
Yu Li 2016년 8월 29일
댓글: Stephen23 2016년 8월 29일
I met a question about dlmread. the .dat file I have, opened with notepad is like below:
however when I open in MALTAB with dlmread('ckcont.txt'), it appears like below:
definitely difference, expecially at column 1.
however when I use load('ckcont4.txt'), the result seems good.
so I want know is there any difference, or a bug there? I sweep about 1 million of such data in more than one week...what a desperate day!
thanks!
  댓글 수: 1
Stephen23
Stephen23 2016년 8월 29일
"is there any difference,"
Between Notepad++ and Microsoft Notepad there is a huge difference! When you tell us incorrect information then it makes it harder for us to help you.

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

채택된 답변

Image Analyst
Image Analyst 2016년 8월 29일
You have some corrupt numbers in there, like "-3.3150-109", that seem to be missing the "E". Also, I'm not sure dlmread() understands exponential notation. You can use importdata instead, after you fix the bad entries that are missing "E"s.
data = importdata('ckcont4.txt', ' ');
  댓글 수: 2
Yu Li
Yu Li 2016년 8월 29일
hi: thanks! I found this problem and solve it. now I have the good entries, and one more question is that I use importdata,load,dlmread, all these commands works while I want import the data, is there any difference between them?
thanks!
Stephen23
Stephen23 2016년 8월 29일
"is there any difference between them?"
They are different functions: they read different kinds of data, they can read different kinds of file formats, they accept different input arguments, they have different output arguments, they throw different errors for different problems, they have different use cases, they have different limitations, they work at different speeds, they support different output classes, they are written differently,...
oh, and some of them read an open file, some rely on a filename.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by