I have query in graph plotting.

1 回表示 (過去 30 日間)
Amy Topaz
Amy Topaz 2022 年 4 月 14 日
コメント済み: Rik 2022 年 5 月 24 日
I have the below function. I need to find the surface plot
z1 = -4:0.002:4;
a11 = -4:0.002:4;
G = atan(((0.03 + a11)./z1)) + atan((0.05 - a11)./z1);
G1 = atan(((0.03 + a11)./z1));
G2 = atan((0.05 - a11)./z1);
G = G1 + G2
%If I find the surface plot of each G1 and G2, I get the following
But when I am plotiing for G, I get the below surface plot. Is it correct?
  4 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2022 年 4 月 14 日
@Amy Topaz Have you provided the detail requirements, like G1 & G2?
Rik
Rik 2022 年 5 月 24 日
I recovered the removed content from the Google cache (something which anyone can do). Editing away your question is very rude. Someone spent time reading your question, understanding your issue, figuring out the solution, and writing an answer. Now you repay that kindness by ensuring that the next person with a similar question can't benefit from this answer.
This page is now on the Wayback Machine.

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

回答 (2 件)

Davide Masiello
Davide Masiello 2022 年 4 月 14 日
編集済み: Davide Masiello 2022 年 4 月 14 日
Try using meshgrid
z1 = -4:0.1:4;
a11 = -4:0.1:4;
[z1,a11] = meshgrid(z1,a11);
G = atan(((0.03 + a11)./z1)) + atan((0.05 - a11)./z1);
G1 = atan(((0.03 + a11)./z1));
G2 = atan((0.05 - a11)./z1);
G = G1 + G2;
surf(z1,a11,G1)
surf(z1,a11,G2)
surf(z1,a11,G)

Star Strider
Star Strider 2022 年 4 月 14 日
Using fsurf
G = @(a11,z1) atan(((0.03 + a11)./z1)) + atan((0.05 - a11)./z1);
G1 = @(a11,z1) atan(((0.03 + a11)./z1));
G2 = @(a11,z1) atan((0.05 - a11)./z1);
G = @(a11,z1) G1(a11,z1) + G2(a11,z1);
figure
fsurf(G, [-1 1 -1 1]*4)
colormap(turbo)
colorbar
.

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by