i am trying to plot this graph in matlab ,first one is graph of domain second graph is of range ,please help me to plot this graph in matlab

 採用された回答

Angelo Yeo
Angelo Yeo 2023 年 9 月 19 日

1 投票

This is very similar to one of questions that I replied to.
Here is my script.
n_rays = 16 + 1;
n_circles = 9 + 1;
n_samples = 200;
rays = linspace(0, 1, n_samples)' * exp(1j*linspace(0, 3.686135, n_rays));
interior_circles = linspace(0, 1, n_circles)' * (cos(linspace(0, 3.686135, n_samples)) + 1j * sin(linspace(0, 3.686135, 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.*exp(1i*pi/2); % 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;

5 件のコメント

Akansha
Akansha 2023 年 9 月 20 日
thankyou so much for the help
Akansha
Akansha 2023 年 9 月 20 日
this error is showing on your code
Angelo Yeo
Angelo Yeo 2023 年 9 月 20 日
Maybe you did not copy and paste the whole code.
Akansha
Akansha 2023 年 9 月 20 日
right, thankyou for your help
Dyuman Joshi
Dyuman Joshi 2023 年 9 月 20 日
Hello @Akansha , if this answer solved your problem, please consider accepting the answer.
Accepting the answer indicates that your problem has been solved (which can be helpful to other people in future) and it awards the volunteer with reputation points for helping you.
You can accept only 1 answer for a question, but you can vote for as many answers as you want. Voting an answer also provides reputation points.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

製品

リリース

R2023b

質問済み:

2023 年 9 月 19 日

コメント済み:

2023 年 9 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by