필터 지우기
필터 지우기

Trying to plot graph in a proper time series manner

조회 수: 1 (최근 30일)
Nathaniel Porter
Nathaniel Porter 2021년 12월 18일
답변: Voss 2021년 12월 18일
*The original file is the csv file and I am trying to get a time series plot of the entire file to determine if it is stationary. Also being able to obtain a correct mean and standard deviation. However not getting a proper plot of all data.
%Plot of entire patient one time series
load ('glucose.mat')
plot(time,glucose),
xlabel('Time'), ylabel('Glucose')
title('Glucose readings for each time of the day')
%Finding the mean of the glucose readings for the time series
M = mean(glucose)
M = 10.1941
%Finding the standard deviation of the glucose readings for the time series
S = std(glucose)
S = 4.8692

채택된 답변

Voss
Voss 2021년 12월 18일
time is the time of day, so it doesn't contain information about the date, only the hours, minutes, seconds within a day. In order to plot the whole thing, you can add time to the datetime array date1 and plot glucose against the result:
%Plot of entire patient one time series
load ('glucose.mat')
plot(date1+time,glucose),
xlabel('Time'), ylabel('Glucose')
title('Glucose readings for each time of the day')
%Finding the mean of the glucose readings for the time series
M = mean(glucose)
M = 10.1941
%Finding the standard deviation of the glucose readings for the time series
S = std(glucose)
S = 4.8692

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time Series Events에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by