function Qkm1 = example_4_2_2_compute_qkm1(a,b, L_Qc_LT, deltaT, Npts) % EXAMPLE_4_2_2_COMPUTE_QKM1 - Computes the discretization process noise matrix Q_{k-1} % % Our system matrix we integrate is given by % % F = [ 0, 1; a, b ]; % % L_Qc_LT = the combined expression of L * Q_c' * L^T as matrix % % Written by: % -- % John L. Weatherwax 2006-08-28 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- F = [ 0, 1; a, b ]; FT = F'; tRange = linspace(0,deltaT,Npts); V = []; for ti = tRange, tmp = expm( F*ti ) * L_Qc_LT * expm( FT*ti ); V = [ V, tmp(:) ]; end Qkm1 = (tRange(2)-tRange(1))*reshape( trapz(V')', size(F) );