필터 지우기
필터 지우기

how to create a 3D cone ?

조회 수: 116 (최근 30일)
ajeet verma
ajeet verma 2017년 7월 24일
댓글: Alexandr Cizek 2020년 11월 22일
i am trying like this
m=1000;
n=1000;
r=2;
h=5;
for i=1:m
for j=1:n
I(i,j)=1/3*pi*r^2*h*i/n;
end
end
imshow(I)
but i am not getting result,please help

채택된 답변

KSSV
KSSV 2017년 7월 24일
r = linspace(0,2*pi) ;
th = linspace(0,2*pi) ;
[R,T] = meshgrid(r,th) ;
X = R.*cos(T) ;
Y = R.*sin(T) ;
Z = R ;
surf(X,Y,Z)
  댓글 수: 4
ajeet verma
ajeet verma 2017년 7월 24일
thankyou
Alexandr Cizek
Alexandr Cizek 2020년 11월 22일
How would I get one with defined radius and height?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by