function FSAn = setEvents(FSA,Ec,Eo)
%[FSAn] = setEvents(FSA,Ec,Eo)
%INPUTS:
%Ec = cell array containing all controllable event names
%Eo = cell array containing all observable event names
%OUTPUTS:
%FSAn = FSA cell array with event properties set


ns = length(FSA);

FSAn = FSA;

for i = 1:ns
    for j = 1:length(FSA(i).events)
        if sum(strcmp(FSA(i).events{j},Eo))
            FSAn(i).obs(j) = 1;
        else
            FSAn(i).obs(j) = 0;
        end
        if sum(strcmp(FSA(i).events{j},Ec))
            FSAn(i).con(j) = 1;
        else
            FSAn(i).con(j) = 0;
        end
    end
end



