function y=tent(x) %FUNCTION y=tent(x) % implements the tent map in Devaney's text y=2*x; idx=find(x>0.5); y(idx)=2-y(idx);