thisfmt = repmat('%f', 1, 40);
data = textscan(dataID, thisfmt);
When you use '%f', 40, then you instruct textscan to use "%f" 40 times total, which would just get you your first line.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!