! ^, r7 f: t; V5 q! z8 I
******************************************** * XeTeX is required to compile this document. * Sorry! ********************************************. \RequireXeTeX ...********************************} \endgroup \fi l.25 \RequireXeTeX ; G) y3 _; K& }, q* _2 v4 X" f
? 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 O0 t$ b9 {% E8 A
?
4 ^7 P6 \7 C1 ]2 H* L************************************************************************************ 源码: % -*- coding: utf-8 -*- ' d7 x6 m: j: f$ J. Q0 W
. R0 w" _4 f3 j% This LaTeX was auto-generated from an M-file by MATLAB. % To make changes, update the M-file and republish this document.
. V1 Q4 N9 b. h$ Q; C\documentclass{article} \usepackage{graphicx} \usepackage{color} 3 J; C% A9 G) C. h
% ++++++++++++ attach the following code % 10:56上午,添加中文支持模块 - t# x" s8 l; A, U9 l7 U
\usepackage{xeCJK} \setCJKmainfont{FangSong_GB2312} % ++++++++++++ finish attaching 5 X8 Z0 p+ T4 v' g: E
\sloppy \definecolor{lightgray}{gray}{0.5} \setlength{\parindent}{0pt} 8 p2 }4 _- A$ `, N' I
\begin{document} 2 Y) w- C0 f3 B: w ^
; [1 g# G( @: Q F, ] \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} ! N, q- ^6 T @- {8 f
\includegraphics [width=4in]{kalmanfilter_01.eps}
$ j% _' ]( l6 Z' D5 B\includegraphics [width=4in]{kalmanfilter_02.eps} 2 V. z) }2 _6 U( B" _( @# S
\includegraphics [width=4in]{kalmanfilter_03.eps}
9 K; V+ B9 ~: z: G+ Q$ Z8 z, c7 l- H& ~. y: x. }
# ^. g2 Q Y, k( p9 {6 \
\end{document} * u7 A( o3 x D! Z3 O
3 I2 v- p1 z$ B2 R, H4 p6 ~& c. W A. b9 o8 C# b. _
|