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

See

http://www.jiskha.com/display.cgi?id=1310887564

The error you are encountering is because the Image CData cannot be complex. In your code, both z and map are complex numbers.

To resolve this issue, you need to modify your code to only use real numbers for the map. Here's an updated version of your code:

```MATLAB
iterations = 80;
grid_size = 500;
[x, y] = meshgrid(linspace(-1.5, 1.5, grid_size), linspace(-1.5, 1.5, grid_size));
c = -.123 + .745i;
z = x + y * i;
map = zeros(size(z));

for k = 1:iterations
z = z.^2 + c;
a = find(abs(z) > sqrt(5));
map(a) = k;
end

figure(1)
image(map)
colormap(jet)
```

In this updated code, we have initialized the `map` variable as a matrix of zeros with the same size as `z`. Then, instead of assigning `x + y * 1i` to `map`, we assign zero to `map` before updating it with the iteration value `k`.

This code should now run without any errors and generate the image you are looking for.

Based on the given information, it seems like you are trying to create an image using the quadratic Julia set equation with a specific value of c. However, there seems to be an issue with the complex numbers in your code.

The error message you are seeing is due to the fact that the "image" function in MATLAB does not support complex numbers as the input data. Therefore, you need to modify your code to only use real numbers as the image data.

To fix this issue, you can modify your code in the following way:

```MATLAB
iterations = 80;
grid_size = 500;
[x, y] = meshgrid(linspace(-1.5, 1.5, grid_size), linspace(-1.5, 1.5, grid_size));
c = -0.123 + 0.745i;
z_real = x; % Create a new variable to hold the real part of z.
z_imaginary = y; % Create a new variable to hold the imaginary part of z.
map = x + y*i;

for k = 1:iterations
new_z_real = z_real.^2 - z_imaginary.^2 + real(c); % Update the real part of z.
new_z_imaginary = 2*z_real.*z_imaginary + imag(c); % Update the imaginary part of z.
a = find(abs(new_z_real + new_z_imaginary*i) > sqrt(5));
map(a) = k;
z_real = new_z_real; % Update the real part of z for the next iteration.
z_imaginary = new_z_imaginary; % Update the imaginary part of z for the next iteration.
end

figure(1)
image(map)
colormap(jet)
```

In the modified code, we create two new variables, `z_real` and `z_imaginary`, to hold the real and imaginary parts of z, respectively. We then update these variables in each iteration using the quadratic Julia set equation with the given value of c. It is important to update both variables simultaneously to avoid any inconsistencies.

Finally, we use the "image" function with the colormap "jet" to create the desired image.

Note that the code provided assumes you are using MATLAB, but you can adapt it to any other programming language.