Preface on the Former Post
I had a question related to this post from 4 years ago "Coloring the Mandelbrot Set in Matlab" but I don't have enough reputation to comment directly on the post.
The code Chris Taylor provided in the post was this
function mandelbrot(n, niter)
x0 = -2; x1 = 1;
y0 = -1.5; y1 = 1.5;
[x,y] = meshgrid(linspace(x0, x1, n), linspace(y0, y1, n));
c = x + 1i * y;
z = zeros(size(c));
k = zeros(size(c));
for ii = 1:niter
z = z.^2 + c;
k(abs(z) > 2 & k == 0) = niter - ii;
end
figure,
imagesc(k),
colormap hot
axis square
The Questions
I had two to be exact:
- What is the matrix k for?
- What does the line
k(abs(z) > 2 & k == 0) = niter - ii;
actually mean?
Sidenotes Not Particularly Vital to the Questions
Two more quick things, first being if there is any other way to ask a question about a specific post, please let me know. I would comment on the answer itself but I don't have enough reputation to do that and I also didn't want to submit an "answer" that wasn't really an answer on that person's post. The second matter, is there any way I could just ask the author of the answer (Chris Taylor) directly what that part of his code means? If not is there a way I can tag them in this so that they can see this?
Thank you!