Q:

Execute this script and be amazed by the results! You can try more points to get a clearer picture, but it may take a while to run

0

 Execute this script and be amazed by the results! You can try more points to get a clearer picture, but it may take a while to run.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Ch5Ex11.m

clear

clf

x = rand;

y = rand;

plot(x,y)

hold on

for it = 1:10000

 choic = round(rand*2);

 if choic == 0

 x = x/2;

 y = y/2;

 elseif choic == 1

 x = (x+1)/2;

 y = y/2;

 else

 x = (x+0.5)/2;

 y = (y+1)/2;

 end

 plot(x,y,’r*’)

 hold on

end

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now