필터 지우기
필터 지우기

Quick question on import data

조회 수: 1 (최근 30일)
Jesse
Jesse 2012년 3월 18일
Hey everybody,
Just some sample lines here, and I'm trying to see what they exactly do:
data = importdata('Filename1.dat');
ModelFile = data.data;
Ok - I know the first line above reads in the data from the file.
So what exactly does the second line do (especially the data.data part)?
Now referring to these lines below, I'm trying to model it like the above 2 lines, but I'm getting errors. Can someone explain what I am doing wrong?
helodata1 = importdata('GougeTable.dat');
HeloModelFile1 = helodata1.helodata1;
helodata2 = importdata('MasterDataChart.dat');
HeloModelFile2 = helodata2.helodata2;
Thanks!
-J

채택된 답변

Walter Roberson
Walter Roberson 2012년 3월 18일
and read the Output Arguments section.
HeloModelFile1 = helodata1.data;
HeloModelFile2 = helodata2.data;
  댓글 수: 2
Jesse
Jesse 2012년 3월 18일
Walter,
Thanks for taking a look and the help. I understand it a little better.
One more quick question. My other data file (the MasterDataChart one), I'm still getting an error. It's saying it's unable to load it and that I should try textscan or fread. So I decided to go with fread, and I was going through the routine line by line until I hit an error. Allow me to explain:
helodata2helper = fopen('MasterDataChart.dat'); %Use fopen first to open the file
helodata2 = fread(helodata2helper); %From the help, fread(fileID), so that's the helper
HeloModelFile2=helodata2.data;
The error says "Attempt to reference field of non-structure array." Now I'm confused since this is the error I was getting even before you responded. I thought I was doing ok looking at the help.
Any other advice?
Thanks!
-J
Jesse
Jesse 2012년 3월 18일
Oh sorry, the first 2 lines are ok in that brief code snippet I just sent, but when I do the third line (with the helodata2.data), that's when I get the error. Sorry.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by