Hello there,
I'm working on the following code :
e = 1;
z(1) = 0;
for a = -2:0.01:0.5
for b = -5/4:0.01:5/4
c = a + 1i*b ;
for n = 2:101
z(n) = z(n-1)^2 + c ;
if (abs (z(n)) > 2)
break
end
end
T (e,:) = [a,b,n];
e = e+1;
end
end
The T array is containing pairs of coordinates (a and b) plus a n parameter associated to each pair.
I would like to plot these coordinates and associate a colormap related to the n value (wich is between 2 and 101) in order to get a Mandelbrot set representation.
This is my objective:
Thanks in advance for your help

回答 (1 件)

Star Strider
Star Strider 2021 年 1 月 8 日

0 投票

Try this for the plot:
figure
scatter(T(:,1),T(:,2),10,T(:,3),'filled')
set(gca, 'XColor','none', 'YColor','none', 'GridAlpha',0)
axis('equal')
axis('tight')
colormap(jet(100))
producing:
Experiment with different colormap and related options to get different results.

カテゴリ

ヘルプ センター および File Exchange で Color and Styling についてさらに検索

製品

リリース

R2020b

質問済み:

2021 年 1 月 8 日

回答済み:

2021 年 1 月 8 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by