Thank you for your function. It works absolutely perfect but I am facing a problem when converting the x ticks to mm/dd hh:mm format using datetick command. The eroor message arises specifically when I increase the number of x ticks beyond a certain limit (more than 8 in this case) using linspace command.
Please look at the following code. I have tried to explain its steps in the commented lines. In the end I am pasting the error message I get on running. I would like to know your views on it. Thanks again!
% textdata is a <168x1 double> array with values in 'dd/mm hh:mm:ss' format
% Converts mm/dd hh:mm to numeric values
% data is a <168x1 double> array with numeric format
% linspace('first value of DateTime array', 'last value of DateTime array',
% 'number of XTicks in between')
??? Index exceeds matrix dimensions.
Error in ==> rotateXLabels>createNewLabels at 132
textLabels(ll) = text( ...
Error in ==> rotateXLabels at 35
h = createNewLabels( ax, vals, labels, angle );
Error in ==> HourlyTempPlot at 29