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 日

2 投票

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 日
i need base on the bottom and peaks on the top
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)
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 件)

質問済み:

2017 年 7 月 24 日

コメント済み:

2020 年 11 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by