Q:

creating graph from text file where axis X is date with millisecond precision and Y is value

I have text file like that:
10:00:15:956 0,0155260005803643
10:00:21:968 0,0155280030632315
10:00:21:968 0,0155270018379389
10:00:21:968 0,0155260006126463
10:00:22:069 0,0155239981620611
10:00:22:090 0,0155249993873537

First column is time with millisecond precision and second column is value.
I need to draw graph where axis X is time and axis Y is value.

What function should I use to read file? dlmread, textscan, importdata?
How to force matlab to recognize "time"? I can write time at any needed format (10:00:22:090 or 10.00.22.090 or anything else), but I need matlab to understand and process time labels correctly. For example difference between 10:00:22:090 and 10:00:23:090 is one second and exactly that interval should be use between these labels on axis X. I want to see "time" on axis X and I do not want to convert time to some "unreadable" int values or something like that (number of milliseconds elapsed from 10.00.00 for example.)

A:

You can have it in seconds and use datatics in plots. Note I have a quick fix to deal with comma in the second column. Probably you do not need it.
f = fopen('foo.txt');
data = textscan(f, '%f:%f:%f:%f %f,%f');
fclose(f);

% hh:min:sec:millisec
secvec = [60*60 60 1 1e-3];
x = [data{1:4}] * secvec';

flvec = [1 1e-16];
y = [data{5:6}] * flvec';

xindays = x / (24*60*60);
plot(xindays, y, 'x');
datetick('x', 'HH:MM:SS');

