I have query in graph plotting.

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

Sam Chak
Sam Chak 2022년 4월 14일
편집: Sam Chak 2022년 4월 14일
You forgot to provide a11 and z1
Amy Topaz
Amy Topaz 2022년 4월 14일
provided
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일

0 개 추천

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일

0 개 추천

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
.

카테고리

태그

질문:

2022년 4월 14일

댓글:

Rik
2022년 5월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by