How do I plot this in MATLAB ?
2 次查看(过去 30 天)
显示 更早的评论
Above is the image of circular grid under f(z)=z/(1-z) in "complex tool" given by jim rolf.
I want to plot images of such circular grids (|z|<1) under any complex map f(z)=x(z)+i*y(z) in MATLAB. so if anyone could help me with the code so that i can plot these in MATLAB .
Thanks, i would really appreciate the help!
0 个评论
采纳的回答
Angelo Yeo
2023-8-24
n_rays = 16 + 1;
n_circles = 9 + 1;
n_samples = 200;
rays = linspace(0, 1, n_samples)' * exp(1j*linspace(0, 2*pi, n_rays));
interior_circles = linspace(0, 1, n_circles)' * (cos(linspace(0, 2*pi, n_samples)) + 1j * sin(linspace(0, 2*pi, n_samples)));
interior_circles = transpose(interior_circles);
%% plotting
figure;
subplot(1,2,1);
for i_rays = 1:n_rays
plot(real(rays(:,i_rays)), imag(rays(:,i_rays)),'Color',[88, 140, 102]/ 255)
hold on;
end
for i_circle = 1:n_circles
plot(real(interior_circles(:,i_circle)), imag(interior_circles(:,i_circle)),'Color','r')
end
axis square
xlim([-2, 2])
ylim([-2, 2])
grid on;
subplot(1,2,2);
f = @(z) z./(1-z); % complex function to apply
for i_rays = 1:n_rays
plot(real(f(rays(:,i_rays))), imag(f(rays(:,i_rays))),'Color',[88, 140, 102]/ 255)
hold on;
end
for i_circle = 1:n_circles
plot(real(f(interior_circles(:,i_circle))), imag(f(interior_circles(:,i_circle))),'Color','r')
end
axis square
xlim([-2, 2])
ylim([-2, 2])
grid on;
2 个评论
Angelo Yeo
2023-8-25
Please refer to the doc for "plot".
https://www.mathworks.com/help/matlab/ref/plot.html?s_tid=srchtitle_site_search_1_plot#btzitot_sep_mw_3a76f056-2882-44d7-8e73-c695c0c54ca8
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!