Hello, I have two routines reading different data files (txt). First data file is like that:
2.281000003 2.593500003 2.749750003 3.062250003…
Routine is:
fid = fopen('v2-eq3.txt','r');atensao=fscanf(fid,'%f');fclose(fid);
Result:
2.28102.59352.74983.0623...
Why I can't read the original file correctly?
The second data file (txt) is like that:
0.0141451080390089-0.00224036502008852i0.0163497695135516-0.00258954909383903i0.0141451080390089-0.00224036502008852i...
Routine is:
fid = fopen ('i2-eq3.txt','r'); ii = 1;while ~feof(fid) acorrente(ii, :) = str2num(fgets(fid)); ii = ii + 1;endfclose(fid);
Result:
0.01415-0.0022i0.0163-0.0026i0.0141-0.0022i...
So, what's wrong? Why I can't read the original files correctly? Could someone teach me? Thanks a lot.
Best Answer