Sampling of the cylinder in cylindrical coordinates
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(2 个)
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);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Analysis, Benchmarking, and Verification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!