Using CurrentPoint in UIAxes in AppDesigner with timedate x axis

9 ビュー (過去 30 日間)
Kristoffer Walker
Kristoffer Walker 2025 年 4 月 27 日
コメント済み: Kristoffer Walker 2025 年 4 月 28 日
Folks,
CurrentPoint returns a value that is not a timedate format. I do not know how to handle this. I did a Google search, but could not find the answer. I would like my ButtonDown callback to be able to return a timedate value corresponding to the x-axis:
cPt = app.UIAxesRaw.CurrentPoint(1, 1:2);
But it returns a value around 0.95 always.
Thanks for your help!

採用された回答

Stephen23
Stephen23 2025 年 4 月 28 日
編集済み: Stephen23 2025 年 4 月 28 日
Because all of the data are returned in one array any datetime values are converted into a numeric equivalent (i.e. to provide one homogenous array). You could use DATETIME to convert the relevant x-value back to a DATETIME object, but the easier and more general approach is to use NUM2RULER:
cPt = app.UIAxesRaw.CurrentPoint(1,1:2)
xDt = num2ruler(cPt(1),app.UIAxesRaw.XAxis)
See also:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by