% Generate a trajectory
N = 3600; % size of the sample
m=2; % Number of inputs
l=m; % Number of outputs
n=3; % State-space dimension
P=randn(n,n);
A=P*diag(2*rand(n,1)-1)/P;
B=randn(n,m);
C=randn(l,n);
x=randn(n,1);
for t=1:1000 % Forgot 1000 first samples
    u=randn(m,1);
    x=A*x+B*u;
end
data=zeros(N,m+l);
for t=1:N
    u=randn(m,1);
    y=C*x+0.1*randn(l,1);
    x=A*x+B*u+0.1*randn(n,1);
    data(t,:)=[u',y'];
end
dlmwrite('data.txt',data)
disp([A,B;C,zeros(l,m)])