function dStavy = DynSystemSimulink(VstupySimulink,parametry)
Stavy = VstupySimulink(1:4);
Vstupy = VstupySimulink(5);

nStavy = length(Stavy);
z = Stavy(1:2:nStavy);
zt = Stavy(2:2:nStavy);

m = parametry{1};
M = parametry{2};
L = parametry{3};
g = parametry{4};
b = parametry{5};
Is = parametry{6};

x = z(1);
phi = z(2);
dx = zt(1);
dphi = zt(2);

MaticeM = [M+m          m*L*cos(phi)
           m*L*cos(phi) m*L^2+Is];
VektorQ = [m*L*sin(phi)*dphi^2-b*dx + Vstupy(1)
           m*g*L*sin(phi)];

ztt = MaticeM\VektorQ;
dStavy = [dx;ztt(1);dphi;ztt(2)];