I have written the following code but I didn't get datetime in text file.
datetime = {'2018-05-16 07:57:12','2018-05-16 07:57:13'……} (char array 1058*19),
latitude = [23.0347 23.0351 23.0353…..] (1*1058 double),
longitude = [72.5399 72.5398 7253.93 ….] (1*1058 double)
for y = 1:1:1058 AB(y,1) = datetime(y); AB(y,2) = Lat(y); AB(y,3) = Lon(y); end v = fopen('filename.txt','w'); fprintf(v,'\t%s\t\t%s\t\t%s\n','datetime','Lat','Lon'); %fprintf(v,'%s, %f, %f ',AB);
formatSpec = '%20s \t %2.2f \t %2.2f\n'; [nrows,ncols] = size(AB);for row = 1:nrows fprintf(v,formatSpec,AB(row,:));end
Best Answer