|
楼主 |
发表于 2006-9-8 17:27
|
显示全部楼层
用下面的程序画出的图就更不对了。是程序有问题还是系统有问题呢?
% poincare 图
zz=400;
x1=y(:,1);
dx1=y(:,4);
xx1=x1(20:zz:n2);
dxx1=dx1(20:zz:n2);
figure('unit','normalized','color',[1,1,1]);
H_1 = get(gcf);
set(gcf,'Name','poincare 图','numbertitle','off');
set(gcf,'defaultuicontrolunits','normalized');
set(gcf,'defaultuicontrolfontname','仿宋体');
set(gcf,'defaultuicontrolhorizontalAlignment','left');
plot_1 = plot(xx1, dxx1,'k*');
axis([-2 2 -2.5 2.5])
grid off
% 功率谱
Y=fft(x1);
Y(1)=[];
n=length(Y);
Power=abs(Y(1:n2/2)).^2/n2^2;
freq=400/T*(1:n2/2)./n;
figure
plot(freq,Power,'k')
axis([0 2 0 0.05])
title('功率谱');
xlabel('频率');ylabel('位移') |
|