Filter löschen
Filter löschen

how to create a 3D cone ?

116 Ansichten (letzte 30 Tage)
ajeet verma
ajeet verma am 24 Jul. 2017
Kommentiert: Alexandr Cizek am 22 Nov. 2020
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

Akzeptierte Antwort

KSSV
KSSV am 24 Jul. 2017
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 Kommentare
ajeet verma
ajeet verma am 24 Jul. 2017
thankyou
Alexandr Cizek
Alexandr Cizek am 22 Nov. 2020
How would I get one with defined radius and height?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by