필터 지우기
필터 지우기

Not getting proper time series plot

조회 수: 1 (최근 30일)
Nathaniel Porter
Nathaniel Porter 2021년 12월 19일
댓글: Nathaniel Porter 2021년 12월 19일
The csv file is left in a table format, then A2:D60 is selected for day 1 and then imported. This set if data is then named glucose1_1. For some reason not getting a good time series plot.
%patient 1 Day 1
%Formatting the date with time
glucose1_1.date.Format = 'dd.MM.uuuu HH:mm';
glucose1_1.time.Format = 'hh:mm:ss.S';
%Adding the date with time to the first column
glucose1_1.date = [glucose1_1.date glucose1_1.time];
%Changing glucose values from mmol/L to mg/dL by multiplying 18
glucose1_1.glucose = glucose1_1.glucose*18;
%plotting 3-5 cycles of glucose data over 6 days
plot(glucose1_1.date,glucose1_1.glucose);
grid on; legend('Patient1, Day1');
xlabel('Date and Time'); ylabel('Serum Glucose Level (mg/dl)');
hold on;
M1 = mean(glucose1_1.glucose)
S1 = std(glucose1_1.glucose)
  댓글 수: 1
Nathaniel Porter
Nathaniel Porter 2021년 12월 19일
If it was edited there is no change

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

채택된 답변

Walter Roberson
Walter Roberson 2021년 12월 19일
We do not know what you expect the plot to look like?
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/838655/glucose.csv';
glucose1_1 = readtable(filename, 'Range', 'A1:D60');
%patient 1 Day 1
%Formatting the date with time
glucose1_1.date.Format = 'dd.MM.uuuu HH:mm';
glucose1_1.time.Format = 'hh:mm:ss.S';
%Adding the date with time to the first column
glucose1_1.date = glucose1_1.date + glucose1_1.time;
%Changing glucose values from mmol/L to mg/dL by multiplying 18
glucose1_1.glucose = glucose1_1.glucose*18;
%plotting 3-5 cycles of glucose data over 6 days
plot(glucose1_1.date,glucose1_1.glucose);
grid on; legend('Patient1, Day1');
xlabel('Date and Time'); ylabel('Serum Glucose Level (mg/dl)');
hold on;
M1 = mean(glucose1_1.glucose)
M1 = 157.3017
S1 = std(glucose1_1.glucose)
S1 = 19.0553
  댓글 수: 2
Nathaniel Porter
Nathaniel Porter 2021년 12월 19일
Okay yes something like that
Nathaniel Porter
Nathaniel Porter 2021년 12월 19일
Thank you

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by