Matlab: read only header line from a .csv-file

前端 未结 2 1111
-上瘾入骨i
-上瘾入骨i 2021-02-14 02:15

Assume there\'s a myfile.csv with variable names in the first row and decimal numbers in the following ones. In Matlab I\'d like to read the header line and the decimal numbers

2条回答
  •  庸人自扰
    2021-02-14 02:34

    To extract the first line, you just need

    fid = fopen('myfile.csv');
    a = textscan(fid,'%s',1);
    fclose(fid);
    

提交回复
热议问题