MATLAB: Differential equation x˙=−Lx

equationx˙=−lx

how can I write the equation below in matlab? preferably discretized.
x˙=−Lx
L is a 7*7 matrix and x is a 7*2 matrix.

Best Answer

I assume this is a differential equation.
Derivation:
x= -L*x > Laplace transform —>
s*X = -L*X + x0
(sI* + L)*X = x0
X = (s*I + L)^-1*x0 Note: ^-1denotes the inverse
x = expm(-L)*x0 <SOLUTION x0 are the initial conditions
In practical terms:
L = randi(99, 7); % Create Matrix
x0 = randi(9, 7, 2); % Initial Conditions
x = expm(-L)*x0; % Solved System
Related Question