Plotting data points with their respected data & Time
2 次查看(过去 30 天)
显示 更早的评论
I am writting a program that reads in data from a text file from 6 different actutors and what time the scripted commmand took place. I then find what I am looing for and plot the actuator points and their position. However I am also trying to plot what time they were scripted from a datetime cell called dates. It plots the dates as a function of time and not with their respected actuator points. It is working with dates but not the time. If hover over the actuator points it gives the date they took place but not the time. Please help me get time when i hover over these points.
2 个评论
Boxn Hen
2020-7-24
Could you show your codes as below?I want to learn something from your work,although I'm not sure about your question.Thank you!
回答(1 个)
Harsha Priya Daggubati
2020-7-27
Hi,
From R2016b onwards, you can plot datetime objects along with the data you have.
Take a look at the following code:
ds =
10×1 datetime array
02-Feb-2018 11:08:11
02-Feb-2018 12:08:13
02-Feb-2018 01:08:14
02-Feb-2018 02:08:15
02-Feb-2018 03:08:17
02-Feb-2018 04:08:18
02-Feb-2018 05:08:20
02-Feb-2018 06:08:21
02-Feb-2018 07:08:23
02-Feb-2018 08:08:24
r =
0.0179
0.0180
0.0184
0.0184
0.0189
0.0189
0.0189
0.0189
0.0190
0.0190
plot(ds,r);
I attached the plot I got with the above code.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!