Hi all,

I would like to read the data all at once with:
`file_text = fread(fid, inf, 'uint8=>char')`;
and then use strfind to get the indices of the new line characters. unfortunately my calls to strfind are only returning empty arrays:

    strfind(file_text,'\n')
    ans =[]

what am i doing wrong?

 
    strfind(data,'\n')

This searches for backslash and 'n'! So either use:


    strfind(data, sprintf('\n'))

or

    strfind(data, char(10));

And perhaps the file has DOS line breaks, then use:

    strfind(data, char([13, 10]));

相关文章:

  • 2022-12-23
  • 2021-07-07
  • 2022-12-23
  • 2021-12-19
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
猜你喜欢
  • 2022-12-23
  • 2021-12-12
  • 2021-12-12
  • 2021-09-11
  • 2022-12-23
  • 2021-12-12
  • 2021-09-17
相关资源
相似解决方案