Verify this matlab code -


i want plot fractal generated functions:

    x(k+1)=y(k)(1+sin(0.7x(k))-1.2+sqrt(|x|))     y(k+1)=0.21-x(k) 

with initial conditions y(0)=x(0)=0, did following code.

x=zeros(100); y=zeros(100); x(1)=0; y(1)=0;  k=1:100  x(k+2)=y(k+1)(1+sin(0.7x(k+1))-1.2+sqrt(abs(x+1)))  y(k+2)=0.21-x(k+1) end plot(x,y,'.') 

so, right?, or how can fix if wrong?, thing want have fractal,but have run out , gave me isolated points, requirement not join them, therefore want know of code has right sintaxis , works well, thing if doing right thing ;)

thanks lot help.

edition

x=zeros(100); y=zeros(100); x(1)=0; y(1)=0;  k=0:100  x(k+2)=y(k+1)*(1+sin(0.7*x(k+1))-1.2*sqrt(abs(x(k+1))));  y(k+2)=0.21-x(k+1); end plot(x,y,'.') 

using code provided, added line print("mypng.png", "-dpng") , ran code saturn fiddle.

x=zeros(100); y=zeros(100); x(1)=0; y(1)=0;  k=0:100  x(k+2)=y(k+1)*(1+sin(0.7*x(k+1))-1.2*sqrt(abs(x(k+1))));  y(k+2)=0.21-x(k+1); end plot(x,y,'.') print("mypng.png", "-dpng") 

enter image description here


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -