% Data for state estimation problem. Midterm Fall 2010
randn('seed',1);

%Parameters
n = 2;
m = 3;
p = 3;
T = 100;
rho = 3;

% Matrices
A = [0.95 -0.3 
    0.3 0.9];
B = orth(randn(m,n))';
C = randn(p,n);

% Trajectories (input: u, output: y, true state: x_true)
x_true = [0; 0];
u = [];
y = [C*x_true + randn(p,1)];
for i=1:T-1
    v = randn(p,1);
    w = randn(n,1);
    u = [u 2*randn(m,1)]; 
    x_true = [x_true A*x_true(:,end)+B*u(:,end)+w];
    y = [y C*x_true(:,end)+v];
end
