Not getting proper time series plot

1 vue (au cours des 30 derniers jours)
Nathaniel Porter
Nathaniel Porter le 19 Déc 2021
Commenté : Nathaniel Porter le 19 Déc 2021
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 commentaire
Nathaniel Porter
Nathaniel Porter le 19 Déc 2021
If it was edited there is no change

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 19 Déc 2021
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 commentaires
Nathaniel Porter
Nathaniel Porter le 19 Déc 2021
Okay yes something like that
Nathaniel Porter
Nathaniel Porter le 19 Déc 2021
Thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Numerical Integration and Differentiation dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by