Generating chaotic sequence with possitive numbers
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
i want to generate chaotic sequence
without negative numbers
0 Kommentare
Antworten (1)
Dev
am 26 Mär. 2025
To generate a chaotic sequence, we can use a logistic map which is a simple mathematical model that exhibits chaotic behaviour. This logistic map can be defined by the equation:
x_n = r * x_n-1 * (1 - x_n-1), where,
‘r’ is a parameter that should be in the range (3.57 to 4) for chaotic behaviour, and
‘x_n’ is the sequence value at step ‘n’.
To ensure the sequence remains non-negative, we can declare ‘x_0’ and define its initial value between 0 and 1. We can then start the sequence (x_1) with this initial value.
Next, we can use the logistic map equation in a ‘for’ loop to generate the entire sequence. For more information regarding the usage of ‘for’ loop, please refer to the documentation below-
I have also attached a reference code snippet below to generate the same-
% Generate the chaotic sequence
n = 100; % configure accordingly
for i = 2:n % starting with 2 since x_1 is already initialized previously
x(i) = r * x(i-1) * (1 - x(i-1));
end
I hope this resolves the issue.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Nonlinear Dynamics finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!