Seemingly the same inputs into a PLCM function, different outcomes?
Afficher commentaires plus anciens
I wrote a function which worked as the Piecewise Linear Chaotic Map——PLCM which perform the following task: Xn+1=F(Xn,p)= 0<=Xn<p: Xn+1= Xn/p P<=Xn<0.5: Xn+1= (Xn-p)/(0.5-p); 0.5<=Xn<1: Xn+1= F(1-Xn,p). p=0.2
function [outnum] =PLCM(innum,p)
if(innum>=0&&innum<p)
outnum=innum/p;
end
if(innum>=p&&innum<0.5)
outnum=(innum-p)/(0.5-p);
end
if(innum>=0.5&&innum<(1-p))
outnum=(1-innum-p)/(0.5-p);
end
if(innum>=(1-p)&&innum<=1)
outnum=(1-innum)/p;
end
end
The input X0=0.1 and X0=0.9, the result turn out as
PLCM(0.9,0.2) ans = 0.5000 >> PLCM(ans,0.2) ans = 1.0000 >> PLCM(ans,0.2) ans = 1.6653e-015
PLCM(0.1,0.2) ans = 0.5000 >> PLCM(ans,0.2) ans = 1 >> PLCM(ans,0.2) ans = 0 >> PLCM(ans,0.2) ans = 0
After the first round,the ans seem to be the same, but why the same input result in different outputs? Has anyone ever faced such problems? Or is it concerns to the inner computing method of Matlab??
Réponses (0)
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!