Gauss-Markov system from statistical steady-state

3 views (last 30 days)
I would like to write this code in a different way??. I have made some small changes but not sure what other modification could be made to get the same results.
%randn(%state’, 2920); n = 10; N = 100;
A = randn;
A = (0.99/max(abs(eig(A))))*A;
N = 100;
W = randn(10); W = W'*W; Whalf = sqrtm(W); Ex = dlyap(A, W);
subplot(211); cla reset; hold on; subplot(212); cla reset; hold on;
for j = 1:50
x_zero = zeros(n, N+1);
for i = 1:N
x_zero(:,i+1) = A*x_zero(:,i) + Whalf*randn(n,1);
end
x_ss = zeros(n, N); x_ss(:,1) = sqrtm(Ex)*randn(n,1);
for i = 1:N
x_ss(:,i+1) = A*x_ss(:,i) + Whalf*randn(n,1);
end
subplot(211); plot(0:N, x_zero(1,:)); subplot(212); plot(0:N, x_ss(1,:))
end
subplot(211); axis([0 N -50 50]); subplot(212); axis([0 N -50 50])

Answers (0)

Categories

Find more on Axes Appearance in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!