필터 지우기
필터 지우기

How to plot a 3d cylinder ?

조회 수: 5 (최근 30일)
chen fire
chen fire 2016년 9월 18일
답변: Image Analyst 2016년 9월 18일
hey there, I'm tring to plot a 3D cylinder, i wrote this code (and it doesnt work):
R=1;
z= linspace(0,2,.1);
phi= linspace(0,2*pi,pi/10);
[n,m] =meshgrid(z,phi);
x1=R.*cos(m);
y1=R.*sin(m);
z1=n;
surf(x1,y1,z1);
axis equal
thanks a lot !

답변 (1개)

Image Analyst
Image Analyst 2016년 9월 18일
Did you look at the cylinder() function, and the examples in the help? Is there some reason why you don't use that?

카테고리

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