: _6 U+ X; ]( v& I, R; h3 W
******************************************** * XeTeX is required to compile this document. * Sorry! ********************************************. \RequireXeTeX ...********************************} \endgroup \fi l.25 \RequireXeTeX $ c' `& S* F6 [# _& R
? 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. ( H E! t& Z3 |: [* k6 e5 O
? 0 r9 y4 T- V2 H2 E& D; O" j% f
************************************************************************************ 源码: % -*- coding: utf-8 -*-
d2 R* Y2 x& |( ?4 m* p# @, ]. L+ s0 B9 R$ g' r$ r( @2 H
% This LaTeX was auto-generated from an M-file by MATLAB. % To make changes, update the M-file and republish this document.
4 D8 i0 j) ~6 l; V4 W! A\documentclass{article} \usepackage{graphicx} \usepackage{color} + X( o) S0 A; ^7 I: D3 e
% ++++++++++++ attach the following code % 10:56上午,添加中文支持模块
1 C* ]$ ?, O; B) m# ? N7 b5 k4 n5 O\usepackage{xeCJK} \setCJKmainfont{FangSong_GB2312} % ++++++++++++ finish attaching
" g+ U% Y9 `4 z% @, K- X\sloppy \definecolor{lightgray}{gray}{0.5} \setlength{\parindent}{0pt} & ]/ J+ a+ }9 i1 A1 I G, W
\begin{document} 4 @3 I7 K! ^- r. ]& v1 h
& a4 z7 w2 J; C$ \& l% ^- p* ^3 ~
\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}
. f9 g' r) d$ T! d d" p\includegraphics [width=4in]{kalmanfilter_01.eps} ! f: ?! @/ E2 [* K
\includegraphics [width=4in]{kalmanfilter_02.eps}
- v7 P( I' V8 @\includegraphics [width=4in]{kalmanfilter_03.eps} + |6 H: a/ Q5 a
/ {: o1 M) B+ j: S* r2 ] Y6 r. b) |) x- [ w
\end{document} 5 A6 y1 b+ y1 @; W
5 S7 G/ H8 O2 k& m; k4 \) @
0 m0 Y3 o$ S$ ?6 I. Z |