24小时热门版块排行榜    

查看: 302  |  回复: 0

Msan

新虫 (初入文坛)

[求助] 急急急。。。出错,求大神提示

%混沌信号================================================
global a;
global b;
global c;
%r=[-c*(x(1)-x(2));a*x(1)-x(2)-x(1)*x(3);b*(x(1)*x(2)-x(3))];
clear;
global a;
global b;
global c;
b=8/3;c=10;a=28;
t0=[0,100];f0=[1,1,1];
Y=[];
    w0=1.2;
    T=2*pi/w0;
  [t,x]=ode45(@lorenz,t0,f0);
  figure(1);
     subplot(2,1,1);
       plot(t,x(:,1));
       x=x(:,1);
       subplot(2,1,2);
       plot(t,x);
%==========================================================
Fs=100;%采样频率
n=0:1/Fs:1;
%产生含有噪声的序列
u=randn(1,length(n));
u=u*sqrt(1);
power_u=var(u);
%================================

%==================================
xn=3*sin(2*pi*5*n);
figure(2);
subplot(2,2,1);
plot(n,xn);

%=======================================
nfft=4096;
cxn=xcorr(xn,\'unbiased\' ); %计算序列的自相关函数
CXk=fft(cxn,nfft);
Pxx=abs(CXk);
index=0:round(nfft/2- 1);
k=index*Fs/nfft;
plot_Pxx=10*log10(Pxx(index+1));
subplot(2,2,2);
plot(k,plot_Pxx);
%==============================================

xn=3*sin(2*pi*5*n)+u;
subplot(2,2,3);
plot(n,xn);
%========================================
nfft=4096;
cxn=xcorr(xn,\'unbiased\' ); %计算序列的自相关函数
CXk=fft(cxn,nfft);
Pxx=abs(CXk);
index=0:round(nfft/2- 1);
k=index*Fs/nfft;
plot_Pxx=10*log10(Pxx(index+1));
subplot(2,2,4);
plot(k,plot_Pxx);
出错提示
??? Error using ==> lorenz
Too many input arguments.

Error in ==> odearguments at 109
f0 = feval(ode,t0,y0,args{:});   % ODE15I sets args{1} to yp0.

Error in ==> ode45 at 173
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...

Error in ==> Untitled35 at 15
  [t,x]=ode45(@lorenz,t0,f0);
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

智能机器人

Robot (super robot)

我们都爱小木虫

找到一些相关的精华帖子,希望有用哦~

科研从小木虫开始,人人为我,我为人人
相关版块跳转 我要订阅楼主 Msan 的主题更新
信息提示
请填处理意见