Problem reading text file data

조회 수: 1 (최근 30일)
Christopher
Christopher 2013년 10월 22일
댓글: dpb 2013년 10월 22일
Hello all,
I am trying to read some data from a text file within Matlab, but for some reason I keep recieving NaN for every other value in the data file. The data file contains 5 headers of text which I am removing. After the heaers there are 8 columns of numeric data. Below is the code I am using to read in the data file and remove the header.
FID=fopen('file1.dat');
data=textscan(FID,'%f%f%f%f%f','HeaderLines',5,'CollectOutput',1);
flcose(FID);
data=data{1}
time=data(:,1)
strain=data(:,2)
load=data(:,3)
The problem is every other value of the data is showing up as NaN. I cannot figure out why.
Thanks
  댓글 수: 1
dpb
dpb 2013년 10월 22일
Need to see short section of the data file...

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

답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by