Effacer les filtres
Effacer les filtres

I have query in graph plotting.

1 vue (au cours des 30 derniers jours)
Amy Topaz
Amy Topaz le 14 Avr 2022
Commenté : Rik le 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 commentaires
KALYAN ACHARJYA
KALYAN ACHARJYA le 14 Avr 2022
@Amy Topaz Have you provided the detail requirements, like G1 & G2?
Rik
Rik le 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.

Connectez-vous pour commenter.

Réponses (2)

Davide Masiello
Davide Masiello le 14 Avr 2022
Modifié(e) : Davide Masiello le 14 Avr 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 le 14 Avr 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
.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by