data = num2ruler(num,ruler) converts
the numeric values in num to the appropriate values
for the specified ruler. The resulting values depend on both the type
and limits of the ruler input. The output data is
an array the same size as num.
Convert the output of ginput from
a numeric value to the equivalent date value.
Create a plot with dates along the x-axis.
Then, click a point in the axes and use the ginput function
to return the location of the selected point.
t = datetime(2015,1,1:10);
y = rand(10,1);
plot(t,y)
ax = gca;
[x,y] = ginput(1)
x =
5.8168
y =
0.6458
The ginput function returns the location
as numeric values. Use num2ruler to determine the
date value that is equivalent to the numeric value returned for x.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.