I have query in graph plotting.

2 Ansichten (letzte 30 Tage)
Amy Topaz
Amy Topaz am 14 Apr. 2022
Kommentiert: Rik am 24 Mai 2022
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 Kommentare
KALYAN ACHARJYA
KALYAN ACHARJYA am 14 Apr. 2022
@Amy Topaz Have you provided the detail requirements, like G1 & G2?
Rik
Rik am 24 Mai 2022
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.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Davide Masiello
Davide Masiello am 14 Apr. 2022
Bearbeitet: Davide Masiello am 14 Apr. 2022
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 am 14 Apr. 2022
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
.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by