matlab m文件运行不了clcclear all;% 初始条件 %N=150;k=1:1:N;x0=[0;0;10;0];xa0=[15;6;12;150];P0=[10,0,0,0;0,10,0,0;0,0,50,0;0,0,0,1];Pa0=[10,0,0,0;0,10,0,0;0,0,50,0;0,0,0,1];Q=[0,0,1.54,0;0,0,1.54,0;0,0,1.54,0;0,0,1.54,0];H=eye(4);R=[0.02,0,0

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 06:48:10
matlab m文件运行不了clcclear all;% 初始条件 %N=150;k=1:1:N;x0=[0;0;10;0];xa0=[15;6;12;150];P0=[10,0,0,0;0,10,0,0;0,0,50,0;0,0,0,1];Pa0=[10,0,0,0;0,10,0,0;0,0,50,0;0,0,0,1];Q=[0,0,1.54,0;0,0,1.54,0;0,0,1.54,0;0,0,1.54,0];H=eye(4);R=[0.02,0,0
xUkoP+\Jϡ&:x¨p&^21ޢ3LgPӂ &n }}sȹGi!wlpgng^M4@ YQ  dق  Ep I`J´Ei>C>``/ 0yh|^%>DžIٸj|\*$H:9YѳgI `h {d9!4kSHޯW}PHS5 X$<) ` $*ȔA?DE da&2vD- l>N|*/Y*_掕|\*̝*)+h DٺML!V|9_V/.*JV\hdf'2$ eL-o9w'}0i4|-3h/ 4ƉiЛ&W{٢:nay5~Hе#0~1o77oa4txھ< rO Y ENg:WQF=ccص&ݦ!3m:<& n!aKJ$ݧw֘x׳63k/O>׾xc{fu$8d+5s?7ot;oC["~n?~忻A9DiAy M6neQjUxIժ#]ƸiXx3ly@0JFW4/)U:MCCt iĔ& \FxNx>yţY,(rS "o 3a@8 6=p\d7

matlab m文件运行不了clcclear all;% 初始条件 %N=150;k=1:1:N;x0=[0;0;10;0];xa0=[15;6;12;150];P0=[10,0,0,0;0,10,0,0;0,0,50,0;0,0,0,1];Pa0=[10,0,0,0;0,10,0,0;0,0,50,0;0,0,0,1];Q=[0,0,1.54,0;0,0,1.54,0;0,0,1.54,0;0,0,1.54,0];H=eye(4);R=[0.02,0,0
matlab m文件运行不了
clc
clear all;
% 初始条件 %
N=150;
k=1:1:N;
x0=[0;0;10;0];
xa0=[15;6;12;150];
P0=[10,0,0,0;0,10,0,0;0,0,50,0;0,0,0,1];
Pa0=[10,0,0,0;0,10,0,0;0,0,50,0;0,0,0,1];
Q=[0,0,1.54,0;0,0,1.54,0;0,0,1.54,0;0,0,1.54,0];
H=eye(4);
R=[0.02,0,0,0;0,0.02,0,0;0,0,0.01,0;0,0,0,0.01];
fai=0;
faia=150*pi/180;
T=12;
v0=10;
v1=12;
% GREAT SYSTEM AND OBSERVATION NOISE %
w=sqrt(Q)*randn(4,N);
v=sqrt(R)*randn(4,N);
% GREAT STATE AND MEASUREMENT %
for k=1:N
if k==1
F(:,:,k)=[1,0,cos(fai)*T,0;0,1,sin(fai)*T,0;0,0,1,0;0,0,0,1];
Fa(:,:,k)=[1,0,cos(faia)*T,0;0,1,sin(faia)*T,0;0,0,1,0;0,0,0,1];
x(:,k)=F(:,:,k)*x0+w(:,k);
xa(:,k)=Fa(:,:,k)*xa0+w(:,k);
else
F(:,:,k)=[1,0,cos(fai)*T,v0*(k-1)^2*cos(fai)*T;0,1,sin(fai)*T,v0*(k-1)^2*cos(fai)*T;0,0,1,0;0,0,0,1];
Fa(:,:,k)=[1,0,cos(faia)*T,v1*(k-1)^2*cos(faia)*T;0,1,sin(faia)*T,v1*(k-1)^2*cos(faia)*T;0,0,1,0;0,0,0,1];
x(:,k)=F(:,:,k)*x(:,k-1)+w(:,k);
xa(:,k)=Fa(:,:,k)*xa(:,k-1)+w(:,k);
end
end
for k=1:N
z(:,k)=H*x(:,k)+v(:,k);
za(:,k)=H*xa(:,k)+v(:,k);
end
hold on
plot(x(1,:),x(2,:),'r',xa(1,:),xa(2,:),'g')
hold off
新手,文件名问题,为什么数值这么大呢

matlab m文件运行不了clcclear all;% 初始条件 %N=150;k=1:1:N;x0=[0;0;10;0];xa0=[15;6;12;150];P0=[10,0,0,0;0,10,0,0;0,0,50,0;0,0,0,1];Pa0=[10,0,0,0;0,10,0,0;0,0,50,0;0,0,0,1];Q=[0,0,1.54,0;0,0,1.54,0;0,0,1.54,0;0,0,1.54,0];H=eye(4);R=[0.02,0,0

matlab7.0 WinXP环境下可以运行

结果如图