Hi,
so I have a variable that has the time of arrival of different messages from 00:00:00 to 23:59:59. What I want is to get a figure of bars where each bar has the messages from an Hour. There would be a total of 24 bars.
How could I do it?

댓글 수: 4

Mathieu NOE
Mathieu NOE 2021년 10월 14일
hello
so you want to plot a histogram ?
Lei Hou
Lei Hou 2021년 10월 18일
Hi Vicente,
Are you looking for this?
>> bar(duration([1 2 3],0,0),[5 1 10])
Thanks,
Lei
flashpode
flashpode 2021년 10월 18일
Hi yeah I was meant to do that
could you explain why if I put:
bar(Time_AIS1)
I do not get the same figure, I mean my variable is already a duration

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2021년 10월 18일

0 개 추천

As you have data every second, you need to do hourly mean to get 24 values. You have two options.
  1. Reshape the data into 24*m; use mean and then plot the data.
  2. USe retime to get hourly average and then plot.

댓글 수: 1

flashpode
flashpode 2021년 10월 18일
I have a variable of duration and retime gives me a timetable

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

질문:

2021년 10월 14일

댓글:

2021년 10월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by