I am wondering how I can use the lsim() function to solve and plot the Initial Value Response solution to a state space representation problem.
Code:
clear all close all clc
t = [0:0.01:10] x0 = [1;-1] [t,y] = lsim(@sysP1,u,t,x0)
Function:
function dx = sysP1(t, x) A = [0 1; -5 -2]; B = [0;1]; K = [-1 1]; u = K*x; dx = A*x + B*u; end
Best Answer