New to matlab problem plotting

조회 수: 1 (최근 30일)
Silviu Coman
Silviu Coman 2021년 1월 7일
편집: Silviu Coman 2021년 1월 9일
Hello guys! I'm new to matlab and i have to make a 3D plot. I have managed to do that for a 2D graph (like a cross-sectional view) and tried searching for hours on how can i make it a 3D shape but without any luck. I have attached the code i wrote for the 2D version as well as pics of how it looks like and how it's supposed to look like. I hope you can give me some insight on how to do it.
t=linspace(0,2*pi);
r=1.1;
xc=-0.1;
yc=0.05;
x=r*cos(t)+xc;
y=r*sin(t)+yc;
plot(x,y)
axis equal
zeta=x+i*y;
z=zeta+1./zeta; hold on; plot(-1,0,'rs',1,0,'gd'); plot (real(z),imag(z))

채택된 답변

Star Strider
Star Strider 2021년 1월 7일
See: how to convert 2D graph to 3D? for one approach.
The second image looks as though it was copied from my Answer in that post!
  댓글 수: 7
Silviu Coman
Silviu Coman 2021년 1월 8일
Ok, got it. Once more, thank you for clearing this up and i hope you have a great day!
Star Strider
Star Strider 2021년 1월 8일
As always, my pleasure!
You, too!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by