logistic映射 matlab,请求帮助。哪里有matlab产生logistic序列的程序!

function x=logistic(n,level,a,x0)

%Syntax: x=logistic(n,level,a,x0)

%________________________________

%

% Simulation of the Quadratic map.

%    x'=ax(1-x)

%

% x is the simulated time series.

% n is the number of the simulated points.

% level is the noise standard deviation divided by the standard deviation of the

%   noise-free time series. We assume Gaussian noise with zero mean.

% a is the parameter.

% x0 is the initial value for x.

%

if nargin<1 | isempty(n)==1

n=500;

else

% n must be scalar

if sum(size(n))>2

error('n must be scalar.');

end

% n must be positive

if n<0

error('n must be positive.');

end

% n must be an integer

if round(n)-n~=0

error('n must be an integer.');

end

end

if nargin<2 | isempty(level)==1

level=0;

else

% level must be a scalar

if sum(size(level))>2

error('level must be scalar.');

end

% level must be positive

if level<0

error('level must be positive.');

end

end

if nargin<3 | isempty(a)==1

a=4;

else

% a must be scalar

if sum(size(a))>2

error('a must be scalar.');

end

end

if nargin<4 | isempty(x0)==1

x0=0.1;

else

% x0 must be scalar

if sum(size(x0))>2

error('x0 must be scalar.');

end

end

% Initialize

x(1,1)=a*x0*(1-x0);

% Simulate

for i=2:n

x(i,1)=a*x(i-1,1)*(1-x(i-1,1));

end

% Add normal white noise

x=x+randn(n,1)*level*std(x);

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值