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 Center および File ExchangeNumerical 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