remove the header while reading from a text file

14 次查看(过去 30 天)
Hi! I am trying to read a text file by the following command:
a= importdata('D:\Input\0518060.txt') ;
The input file (attached) has a header and followed by a matrix of 480x480 elements. How can I remove the header and use the matrix only for the further operation? Thanks in advance.

采纳的回答

Star Strider
Star Strider 2016-7-19
Use textscan:
fidi = fopen('surjendu 0518060.txt','r');
Datac = textscan(fidi, repmat('%f', 1, 480), 'HeaderLines',1, 'CollectOutput',1);
Data = Datac{1};
The ‘Data’ variable is your (480x480) double array.

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by