%
% Purpose:
% Function to generate a series from a tent map of height equal to 1.
%
% Input
% len - length of time series to generate
%
% Effects:
% Returns time series
%
%
% (c) 2011 Paul Moore - moorep@maths.ox.ac.uk
%
% This software is provided 'as is' with no warranty or other guarantee of
% fitness for the user's purpose. Please let the author know of any bugs
% or potential improvements.
function x = maketent(len)
x = zeros(len,1);
x(1) = 0.8247;
for t=2:len
% the following random value is added to prevent the map from quenching
eps = (rand-0.5)*1e-9;
if x(t-1) < 0.5
x(t) = 2*x(t-1) + eps;
else
x(t) = 2 - 2*x(t-1) + eps;
end
end
end