Plotting data points with their respected data & Time

8 次查看(过去 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
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!
Austin Matuszewski
Austin Matuszewski 2020-7-24
Due to where i work I can't I am sorry. If you have a question feel free to ask and I can try to help

请先登录,再进行评论。

回答(1 个)

Harsha Priya Daggubati
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.

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by