# 5. Source Code

`function t = stcsfp(xo,c,N)% === TENT MAP === %X = 0:.1:1;for n = 1:11 if X(n) >= 0 && X(n) < c  T(n) = X(n)/c; elseif X(n) >= c && X(n) <=1  T(n) = (1-X(n))/(1-c); else  printf("x initial must be from 0 to 1"); endend% === MAIN CALCULATION === %x(1) = xo;for n = 1:N if x(n) >= 0 && x(n) < c  t(n) = x(n)/c;  x(n+1) = t(n); elseif x(n) >= c && x(n) <=1  t(n) = (1-x(n))/(1-c);  x(n+1) = t(n); else  printf("x initial must be from 0 to 1"); endend%Plot Tent Map%figureplot(X, T, xo, t(1));title("Tent Map");xlabel("X");ylabel("T");%legend("fill this in")%Plot Sequence%figureplot(t);title("Sequence Generated");xlabel("n");ylabel("t(n) or x(n+1)");ylim([-0.1 1.1]);%legend(["fill this in"]);%xlim([1 20])%Plot Histogram%figurehist(t, 0:.01:1);title("Distribution");xlabel("Value");ylabel("Count");xlim([-0.1 1.1]);`

# Mirrors

this blog contains all my articles licensed under creative commons attribution customized sharealike (cc-by-sa) where you can sell but mention the open one here

## More from Fajar Purnama

this blog contains all my articles licensed under creative commons attribution customized sharealike (cc-by-sa) where you can sell but mention the open one here

## Some Infinities Are Bigger Than Others

Get the Medium app