MATLAB: Read text file without header and separate columns

skip linestext file

Dear Matlab Team,
my problem is as follows. I could not find a solution in other forums, but none seem to work for my issue:
I have a text file with a big headliner, which I want to skip. The data I need starts in line 194 and has 50.000 values. There are 3 values in each row, sperated by ",". Basically, what I need is to extract the 50 000 values and put it in matrix with 3 columns for further analyzation.
This is how the file looks like (starting from below "DATA BLOCK…"]
...
[DATA BLOCK 1-1-1]
0.00000,20.47668,0.13959
0.00010,20.46021,0.16467
0.00020,20.47668,0.11914
0.00030,20.48767,0.19208
...
How can I separate this data and create a matrix from it?
Thanks in advance,
Philipp

Best Answer

You can use the readmatrix function.
A = readmatrix(filename,'NumHeaderLines',193);
Edit:
As Walter suggested below: releases older than R2019a are missing the readmatrix function. On R2013b or newer, the readtable function can help out:
A = table2array(readtable(filename,'NumHeaderLines',193, 'readvariablenames', false));