file io - matlab exporting data -


I have a postal card, out of which data can be obtained every 100 ms continuously. Now I want to create a txt file that contains all the data. This txt file should also have a time stamp and it should have 5 column headers - Zit, Channel 1, Channel 2 .... Channel 4

This is the code that I could write but I am confused about how to print the data, every 100 ms second after headers comes new data and add it to the end of the file is. The time stamp is in a specific format because later I need to find a number.

If you do not close the file, then there is no reason to open it twice is not. Two consecutive fprintfs will start after you first fopen:

  fprintf (fid, '% s \ t', datestr (now, 'mmmm dd, yyyy hh: MM: SS.FFF' )) Fprintf (fid, '% s \ t% s1 \ t% s2 \ t% s3 \ t% s4 \ t', 'Zeit', datannam, datenam, datenam, datannum)   < Remember to use fclose (fid) at this point to set the P> header now you can loop through each time you read your data and append  fida = fopen ('acq.txt', 'a ') Can open the file; After formatted data output:  
  fprintf (fida, '% f% f% f% f% f% f% f% f% f% f \ n', data ') For the first time, matlab displays data in the first row for any reason, so it transpositions it, puts it in the same size as the data shown in matlab. is. Remember to turn off these files or you can get errors.   

Comments