-
Notifications
You must be signed in to change notification settings - Fork 0
/
set_index.m
21 lines (18 loc) · 599 Bytes
/
set_index.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function index = set_index(x,Preset)
% Author: Mehran Attar
% Written: 08-March-2023
% Last update:
% Last revision: 30-July-2023
% This function computes the set membership index for data-driven ROSC sets
% to used for data-driven ST-MPC control algorithm
%------------- BEGIN CODE --------------
for i=1:max(size(Preset))
if Preset{i}.contains(x)== 1
% if Preset{i}.mptPolytope.P.A * x <= Preset{i}.mptPolytope.P.b == 1
index = i;
break
end
index = i;
end
%------------- END CODE --------------
end