-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdataAcquisition.m
31 lines (20 loc) · 1.13 KB
/
dataAcquisition.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
clear all
close all
database ='database/until12_07_26.sqlite';
startDate = '2012-06-26 00:00:00';
endDate = '2012-07-15 00:00:00';
addpath(genpath('src/dataAcquisition'));
fprintf("Extracting and computing the Bayesian Network with data from <strong>%s</strong> to <strong>%s</strong>.\n", startDate, endDate);
[bNet, timeline] = computeBnet(database, startDate, endDate);
fprintf("Zplug consumption from <strong>%s</strong> to <strong>%s</strong>.\n", startDate, endDate);
disp('------------------------------------------------------------------------------------');
disp("[11/10] Extracting data from the 'Zplug' sensor.");
zPlug = unionZplug(database, startDate, endDate);
disp("[12/10] Calculating the minumum, the maximum, and the average of Zplug consumption.");
[ minZplug, maxZplug, avgZplug ] = matchingZplugWattInterval(zPlug, timeline);
disp('------------------------------------------------------------------------------------');
fprintf("Appending all these variable to '<strong>dataBNet.mat</strong>'...");
save('bNet_data.mat','zPlug', 'minZplug', 'maxZplug', 'avgZplug', '-append');
fprintf("done!\n");
clear all
load('bNet_data.mat');