- C4 }4 n& X% V& p- m& S/ r
******************************************** * XeTeX is required to compile this document. * Sorry! ********************************************. \RequireXeTeX ...********************************} \endgroup \fi l.25 \RequireXeTeX $ d( `6 U: U. T& Q& w
? h This error message was generated by an \errmessage command, so I can't give any explicit help. Pretend that you're Hercule Poirot: Examine all clues, and deduce the truth by order and method. 4 t' v) B2 }+ i# q
?
. c6 \! m; n I9 J- R% _% O1 @************************************************************************************ 源码: % -*- coding: utf-8 -*- 3 L( |, {$ O$ T. q5 P* x
0 y; _# ]( W2 N/ p1 q1 H% This LaTeX was auto-generated from an M-file by MATLAB. % To make changes, update the M-file and republish this document. % e8 J l2 f- h7 z* t q
\documentclass{article} \usepackage{graphicx} \usepackage{color} * ?! B6 p) f, J
% ++++++++++++ attach the following code % 10:56上午,添加中文支持模块
4 ]# v4 c. _# W* g6 b3 A+ x\usepackage{xeCJK} \setCJKmainfont{FangSong_GB2312} % ++++++++++++ finish attaching . ^ R j! F! N7 h2 c P5 ]! x
\sloppy \definecolor{lightgray}{gray}{0.5} \setlength{\parindent}{0pt}
: S& _8 F; ]2 s, B9 h- }\begin{document}
; Y! s" I9 |8 O6 |2 D4 T9 X' Z a* K1 x& X" Q' Z. N
\begin{verbatim} %fhunction kalmanfilter % 2010-4-15, luyz23, 从MATLAB到latex的简单示例 % >> publish('kalmanfilter.m','latex') % -*- 卡尔曼滤波 -*- % 此范例源自:网络论坛,在此感谢 clear N=800; w(1)=0; w=randn(1,N); %系统预测的随机白噪声 x(1)=0; a=1; for k=2:N; x(k)=a*x(k-1)+w(k-1); %系统的预测值 end V=randn(1,N); %测量值的随机白噪声 q1=std(V); Rvv=q1.^2; q2=std(x); Rxx=q2.^2; q3=std(w); Rww=q3.^2; c=0.2; Y=c*x+V; %测量值 p(1)=0; s(1)=0; for t=2:N; p1(t)=a.^2*p(t-1)+Rww; %前一时刻X的相关系数 b(t)=c*p1(t)/(c.^2*p1(t)+Rvv); %卡尔曼增益 s(t)=a*s(t-1)+b(t)*(Y(t)-a*c*s(t-1)); %经过滤波后的信号 p(t)=p1(t)-c*b(t)*p1(t);%t状态下x(t|t)的相关系数 end figure(1); plot(x); title('系统的预测值'); figure(2); plot(Y); title('测量值'); figure(3); plot(s); title('滤波后的信号'); \end{verbatim}
+ ^' J1 M7 D. o3 U4 ~; X. I\includegraphics [width=4in]{kalmanfilter_01.eps} 5 H8 R6 ~) t# s5 @5 l" {) [7 G& Z
\includegraphics [width=4in]{kalmanfilter_02.eps}
& L' \, ]& d+ ~' A\includegraphics [width=4in]{kalmanfilter_03.eps} ) @0 V0 T3 B2 l6 D1 ^1 p4 F
/ W9 h* |+ `3 H+ u% l
6 `& ~5 z; k U6 |2 l\end{document} ; T( Q7 V& Z; X& V* q9 I% _
. r/ b, k4 K2 s0 P9 k& P8 n2 f* W
|