using datenum results in not showing both strings <p><strong>1. How do I read in this data properly so that the date parses properly?</strong> I am trying to concatenate strings I read from a file but the output I get is mixed up. The output is the x axis.Also, the spacing from x axis has numbers instead of the string I want. The file has 4 columns,date,time,temperature and value. The date is "01.01.2013 " and the time "09:08:02"</p> <p>Also, if I want to use only first column (with date) how can I do this? Because using datenum(mydata{1}) results to "Cannot parse date 01.01.2013"</p> <pre><code>... mydata = textscan(fid, '%s %s %f %f', 'delimiter',';', 'HeaderLines',1); date={}; temp={}; .. date{1}=datenum( strcat(mydata{1},{' '},mydata{2}) ); ... </code></pre> <p><strong>2. How do I correct the axis ticks?</strong> </p> <p>I am then trying to plot data using plotyy and want the x-axis to be the date, but I am getting two different axis labels.</p> <p>Here is the code I am using:</p> <pre><code>temp = mydata{4}; plotyy(date,temp,date,2*temp); datetick('x','mmm.dd,yyyy'); </code></pre> <p>Here is the resulting image:</p> <p><img src="https://i.stack.imgur.com/tpYGR.png" alt="enter image description here"></p> <p>---------------UPDATE---------------------------------------</p> <p>Here is the code:</p> <pre><code>fid = fopen('test2.txt','r'); mydata = textscan(fid, '%s %s %f %f', 'delimiter',';', 'HeaderLines',1); fclose(fid); date=datenum( strcat(mydata{1},{' '},mydata{2}),'mmm.dd,yyyy HH:MM:SS' ); temperature=mydata{3}; value=mydata{4}; [AX,H1,H2]=plotyy(date,temperature,date,value,'plot'); set(get(AX(1),'Ylabel'),'String','Temperatures'); set(get(AX(2),'Ylabel'),'String','Value'); set(H1,'LineStyle','--'); set(H2,'LineStyle',':'); datetick(AX(1),'x','mmm.dd,yyyy'); title('Temperatures - Values'); xlabel('Date') </code></pre> <p>and the file</p> <pre><code>Date;Time;Temp;value Jan.01,2013; 11:00:00;20;10 Feb.08,2013; 12:00:00;23;11 Mar.04,2013; 04:02:00;24;15 Apr.10,2013; 08:04:00;28;20 May.10,2013; 12:05:00;32;30 Jun.04,2013; 10:06:0;33;27 </code></pre>