Converting date/time stamp in output file to Matlab date/time
Ältere Kommentare anzeigen
I have a csv file with data that is time stamped. The date/time is in the following format: 2013/2/12-3h49:26. I was able to import the date/time stamps as strings in a cell array. I now want to convert the date/time from a string to a numeric value so I can use it to graph the data. I looked at using datestr(D,F) and datevec(D,F) but the format of my time stamp does not match any of the Matlab formats 'F'. I tried using sscanf and was able to get it to work for a single string variable but I did not know how (or if it can) be used for an array comprised of strings. I also tried fscanf but was unable to get it to read the data. As an example I used the following to see if I could read the year only:
fid=fopen('WZ-CONT-2013_2_12.csv');
year=fscanf(fid,'%f');
fclose(fid);
If I am reading the csv file, it needs to read a specific column but skip the first two rows amd read until there are no more entires (number of readings may vary).
Example date/time stamps:
2013/2/12-3h49:26
2013/2/12-3h59:26
2013/2/12-4h9:26
2013/2/12-4h19:26
Thanks in advance for your help!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Time Series Events finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!