Change uiAxes DateNum to DateTime in AppDesigner for animatedLine Plot
5 ビュー (過去 30 日間)
古いコメントを表示
Here, I have a UIAxes; with datenum tick marks. I have the values of x-ticks in String, as you can see from Time Field. I used datetickzoom and dynamicdateticks; but the zoom function gave error. Is there any possibility of changing these dateNum x-ticks to datetime ticks. It'll be better to use dynamic, but if there's no way for that, static vector ticks will also work.

0 件のコメント
採用された回答
Cris LaPierre
2020 年 6 月 3 日
Can you convert your X data to datetime before plotting? Plots support datetimes as x values. You can convert a string to datetime using the datetime('06-Jun-2020 02:26:26') syntax.
3 件のコメント
Cris LaPierre
2020 年 6 月 3 日
編集済み: Cris LaPierre
2020 年 6 月 3 日
If the appearance and labels are important, which I imagine they are, I would be inclined to suggest using plot instead of animatedline. Since I don't have your code, here's a simple example.
Somewhere, initialze the plot
l = plot(app.UIAxes,x(1),y(1,1))
Then, when you want to add points, update the XData and YData properties of your line object l.
l.XData = x(1:k);
l.YData = y(1:k,1);
And when you want to clear the points, you could do this.
l.XData = [];
l.YData = [];
I don't have your code, so you may need to do some slight modification to get this to work. If you are in app designer, you might also need to add l to your app properties, and reference it using app.l.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Animation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!