-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutputData.m
More file actions
32 lines (31 loc) · 804 Bytes
/
outputData.m
File metadata and controls
32 lines (31 loc) · 804 Bytes
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
function outputData(inp,x,u,z,M,method,cost,h,h_xlim)
figure();
subplot(5,1,1);
hold on
plot(x(1,:));
plot(x(3,:),'--');
plot(x(4,:),'-.');
axis([1, inp.N, -40, 50]);
xlabel('k'); ylabel('Ta Tref(-) To(-.)');
if (method == 'New')
title(['beta-ASOCP control policy for day=' num2str(inp.dayn) '. Cost=' num2str(round(cost))]);
else
title(['LQR control policy for day=' num2str(inp.dayn) '. Cost=' num2str(round(cost))]);
end
subplot(5,1,2);
stairs(z(:),'--');
axis([1, inp.N, 0.5, 3.5]);
xlabel('k'); ylabel('User feel');
subplot(5,1,3);
stairs(M(:,1));
axis([1, inp.N, -0.5, 1.5]);
xlabel('k'); ylabel('Occupancy');
subplot(5,1,4);
plot(u(:));
axis([1, inp.N, -1050, 1050]);
xlabel('k'); ylabel('Control');
subplot(5,1,5);
histogram(h);
xlim([0, h_xlim]);
hold off
end