[SOLVED] Matlab data reading excluding headers

Status
Not open for further replies.

von Moltke

Junior Member level 1
Joined
Sep 11, 2012
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Turkey-Ankara
Activity points
1,439
Hello there,

I have txt. files which are recorded by some oscilloscope in the format:

LECROYSDA813Zi,51921,Waveform
Segments,1,SegmentSize,20000002
Ampl
-0.075
-0.075
0.075
-0.06875
0.0625
-0.0625

How can I get the only the amplitude data into MATLAB, without deleting header lines in the txt.?

Thanks in advance..
 

In "Current Folder" window in Matlab, klick right mouse button on a file that You want to import, and then choose "import data" from menu.
After that You just declare the "number of text in header lines" at the top right side of the import wizard window
 
Hello again,

A friend of mine proposed a single code fragment:

----
fid = fopen('text.txt','rt');
datas = textscan(fid','%f','headerLines',3);
data = datas{1}
fclose(fid);
----

and it worked! Wanted to announce here..
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…