Changeset 1191 for library

Show
Ignore:
Timestamp:
09/17/10 14:35:05 (14 years ago)
Author:
smidl
Message:

OO implementation of Kalman in Matlab

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/tests/stresssuite/kalman_stress.m

    r1190 r1191  
    4747oll=0; 
    4848 
     49Mu = zeros(2,N); 
     50Mu_oo = zeros(2,N); 
     51 
    4952tic; 
    5053for t=2:N 
     
    6871%keyboard 
    6972 
     73%%%%%%%% OBJECTs in MATLAB %%%%% 
     74addpath ../../../applications/bdmtoolbox/mex/mex_classes 
     75 
     76oKAL=mexKalman; 
     77oKAL.A = A; 
     78oKAL.B = B; 
     79oKAL.C = C; 
     80oKAL.D = D; 
     81oKAL.Q = Q; 
     82oKAL.R = R; 
     83oKAL=oKAL.validate; 
     84oKAL.apost_pdf.mu = mu0; 
     85oKAL.apost_pdf.R = P0; 
     86 
     87tic; 
     88for t=2:N 
     89    oKAL=oKAL.bayes(y(t),u(t)); 
     90    Mu_oo(1:2,t) = oKAL.apost_pdf.mu; 
     91end 
     92exec_matlab_oo=toc 
     93 
    7094!./stresssuite kalman_stress 
    7195itload('kalman_stress_res.it'); 
     
    7599hold on 
    76100plot([Mu]','--'); % shift the predldmatictions 
     101plot([Mu_oo]',':'); % shift the predldmatictions 
    77102plot(xth2','+'); 
    78103plot(xthE','o');