% Vypocet doplnku prvku matice S pro pozdejsi urceni vazebnich
%  clenu maticoveho regulatoru R

syms s;
syms S11 S12 S13 S14 S15 S21 S22 S23 S24 S25 S31 S32 S33 S34 S35 S41 S42 S43 S44 S45 S51 S52 S53 S54 S55 

S = [S11 S12 S13 S14 S15;
     S21 S22 S23 S24 S25;
     S31 S32 S33 S34 S35;
     S41 S42 S43 S44 S45;
     S51 S52 S53 S54 S55];
 
s = cell(5,5);

for i = 1:5
    for j = 1:5
        s{i,j} = (-1)^(i+j)*det(fdeterm(i,j,S));
    end
end
