Plotting data points with their respected data & Time
3 views (last 30 days)
Show older comments
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 Comments
Boxn Hen
on 24 Jul 2020
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!
Answers (1)
Harsha Priya Daggubati
on 27 Jul 2020
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 Comments
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!