mgts.m

来自「Matlab程序用作混沌时间序列的预测。」· M 代码 · 共 21 行

M
21
字号
% This is a function for generation Mackey-Glass Time Series
% Fix the value of n = 1000 to 10000
% MG Series is periodic for tau<17 otherwise non-periodic
% Initial values are generated randomly using rand function
% Eular's method is for solving MG diffrential equation
% ds(t)/dt = 0.2s(t-tau)/(1+s(t-tau)^10) - 0.1s(t)

function mydata = mgts(n);
tau = 30;
for t = 1:n
    if t<= tau
        s(t) = rand;
    else
        s(t) = 0.9*s(t-1)+(0.2*s(t-tau))/(1+s(t-tau)^10);
    end
end
mgs = s';

mydata = mgs(1001:2000)';
t=1001:2000;
% plot(t, mydata);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?