-
Notifications
You must be signed in to change notification settings - Fork 1
/
plot_results.m
42 lines (34 loc) · 891 Bytes
/
plot_results.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
load data.mat
time = diabetic(1,:);
glucose_sp = diabetic(2,:);
insulin = diabetic(3,:);
meals = diabetic(4,:);
glucose = diabetic(5,:);
figure(1)
hold off
subplot(3,1,1)
hold off
plot(time,insulin,'b-','LineWidth',2)
axis([min(time) max(time) 0 10]);
legend('Insulin Injection')
ylabel('Insulin (\muU/min)')
subplot(3,1,2)
hold off
plot(time,meals,'k-','LineWidth',2)
legend('Meal Glucose')
axis([min(time) max(time) 800 2000]);
ylabel('Glucose Digestion')
subplot(3,1,3)
hold off
plot(time,glucose_sp,'m-','LineWidth',2)
hold on
plot(time,glucose,'b:','LineWidth',2)
legend('Glucose SP','Blood Glucose')
axis([min(time) max(time) ...
min(min(glucose),min(glucose_sp))-10 ...
max(max(glucose),max(glucose_sp))+10]);
ylabel('Glucose (mg/dl)')
xlabel('Time (hr)')
% save data to text file
data = diabetic';
save -ascii 'data.txt' data