the solution i found was to use equationsToMatrix(equations,list). I created a 'list' with all the simbolic variables x and u and it gave me the matrix
equivalent to
then I just had to split the matrix into two. As i said in the answers bellow, I don't know any built in matlab function to solve the diferential riccati equation, so I'll have to use the system matrices(Riccati diferential equations's parameters) to solve it with ode45.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1289315/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1289320/image.png)