apparently I was skipped by accident

13.2 A quadratic Julia set has the form

z(n+1)=z(n)^2+c

The special case where c=-.123+.745i is called Douday's rabbit fractal. Follow example 13.1, and create an image using this value of c. For the Madelbrot image, we started with all z-values equal to 0. You'll need to start with z=x+yi. Let both x and y vary from -1.5 to 1.5.

I'm really confused by this question. Here's my attempt at a solution. I really hope someone can help me. My book did a very bad explaining the matter.

Code:
>> iterations=80;
grid_size=500;
[x,y]=meshgrid(linspace(-1.5,1.5,grid_size),linspace(-1.5,1.5,grid_size));
c=-.123+.745*i;
z=x+y*i;
map=x+y*i;
for k=1:iterations
z=z.^2+c;
a=find(abs(z)>sqrt(5));
map(a)=k;
end
figure(1)
image(map)
colormap(jet)
??? Error using ==> image
Error using ==> image
Image CData can not be complex

2 answers

We have only one or two tutors who can help with programming, and they don't get online every day. Please be patient.
It looks to me that your code follows the logic correctly.
There is a minor error which caused the error message, namely you have defined the map matrix to be complex. When it comes to plot, it causes difficulties.

On line 6, try setting all values to zero
map=zeros(grid_size, grid_size)
which will be replaced by the (max) number iterations during the iterations.

Using a grid of 51 (instead of 500), it gives me a pattern not dissimilar to what's expected. I am not able to test the plotting part.

Try and post to let us know if it works or not.
Similar Questions
  1. "hi,jules did you see my text" asked alexandra"yes" exclaimed julia "i told you what would happen come on lets go to class" what
    1. answers icon 3 answers
    1. answers icon 1 answer
  2. Consider the argument:Esteban or Morgan will clean the kitchen tonight. If Esteban cleans the kitchen, some of the dishes will
    1. answers icon 1 answer
  3. What do you learn from these stage directions?[The faintest trace of a smile on her lips] A. Julia is suddenly very happy. B.
    1. answers icon 6 answers
more similar questions