필터 지우기
필터 지우기

Sampling of the cylinder in cylindrical coordinates

조회 수: 1 (최근 30일)
Rashid
Rashid 2012년 9월 18일
Hi everyone, I am struggling in creating and sampling of a cylinder in cylindrical coordinates, I used cylinder() func but it gives a cylinder just in a height of 1, whereas I need a variable heights... And after that I need to be able to sample the cylinder in both Z axis and theta axis

답변 (2개)

Ryan G
Ryan G 2012년 9월 18일
This is all very well explained in the doc, but here it goes.
[X,Y,Z] = cylinder(r,n); %r is radius n is number of points oyu want
[THETA,RHO,ZP] = cart2pol(X,Y,Z); %convert to polar coordinates
If you want to adjust the height you simply adjust Z in either polar or cartesian coordinate. You can use a gain:
Z = Z*1.5;
or a bias:
Z = Z + 5;
If you want to re-plot the data try
surfc(X,Y,Z);

Rashid
Rashid 2012년 9월 19일
but plotting is done just in cartesian, what about cylindrical coordinates? and what about sampling?

카테고리

Help CenterFile Exchange에서 Analysis, Benchmarking, and Verification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by