Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Matlab-Programs-for-Nonlinear-Dynamics/Lozi2.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
46 lines (36 sloc)
893 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Lozi.m | |
clear | |
B = -1.00; | |
C = 0.5; | |
%h = colormap(hsv); | |
h = colormap(jet); | |
f1 = figure(1); | |
f1.Position = [382 147 976 808]; | |
dum = set(f1); | |
for itloop = 1:50 %200 | |
itloop | |
rn = ceil(255*rand); | |
xlast = randn; | |
ylast = randn; | |
% for transloop = 1:100 % Transient loop not needed for Hamiltonian case | |
% xnew = 1 + ylast - C*abs(xlast); | |
% ynew = B*xlast; | |
% xlast = xnew; | |
% ylast = ynew; | |
% end | |
figure(1) | |
%axis([-160.5 160.5 -160.5 160.5]) | |
axis([-2 2 -2 2]) | |
%clf | |
hold on | |
for loop = 1:500 | |
xnew = 1 + ylast - C*abs(xlast); | |
ynew = B*xlast; | |
xlast = xnew; | |
ylast = ynew; | |
plot(real(xnew),real(ynew),'o','MarkerSize',3,'LineWidth',0.5,'Color',h(rn,:)) | |
end | |
%plot(real(xnew),real(ynew),'o','MarkerSize',2,'Color','r') | |
pause(0.001) | |
%hold off | |
end |