Hi Steven,
Sorry if I haven´t been clear enough of what I am trying to accomplish...
It´s no problem for me to create a less dense datetime vector.
My problem is how to create a ticklabel axis with datetime values that scales automatically.
And the only reason for this is because my plot is slow at updating if I choose new data to plot because it has to convert all of the datenum values to datetime values instead of just some of them.
But thanks to your first question, regarding how I was doing the conversion, I figured out that I was converting the datenum values to a string before the final conversion to datetime values:
XData = datetime(datestr(XData))
I think I copied the line of code from somewhere and thought it might needed to be converted to datestr first, but I just figured out that I can apply this instead:
XData = datetime(XData,'ConvertFrom','datenum')
Now it converts more than 2 million datenum values to datetime values in 0.038462 second so that’s more than fine for me!
Thanks again 😊