# Discretizing my continuous system in Matlab

I was hoping someone could help me with conducting my discretization in MATLAB. I have a linear system with known data: sampling interval $$T$$, system matrix $$\mathbf{A}$$, input matrix $$\mathbf{B}$$, output matrix $$\mathbf{C}$$ and direct feed-through $$\mathbf{D}$$.

Now I need to manually compute the discrete system in MATLAB, I know that: $$x[k+1] = \phi x[k]+\gamma u[k]$$

Now the question is how to compute $$\phi$$ and $$\gamma$$ in MATLAB, I hope someone can help me there, I know that $$\phi = e^{\mathbf{A}T}$$ and $$\gamma = \int_0^T e^{\mathbf{A}x}\mathbf{B}dx$$. I am not very familiar anymore with MATLAB syntax, it would be huge help if someone could show me how to type this in MATLAB, then I can start analyzing the system for myself. Thanks in advance :)

• I don't understand what your modeling of course, but is your question really just how to do the integral in MATLAB? Mar 28, 2020 at 20:49
• Matlab has a function that does that, but I think it's in the Control Systems Toolbox (I don't use Matlab, so -- I dunno). Have you done a websearch? In Scilab the function is called dscr; some of those function names are the same between Matlab and Scilab. Mar 28, 2020 at 21:42
• @Engineer I have found it out now, I forgot that there was such an easy function for the matrix exponential. It was my problem getting that one in the integral without using Cayley-Hamilton manually, but now I have found it thanks :) Mar 29, 2020 at 9:41