如何在 MATLAB 中绘制具有不同半径的圆顶?
我需要绘制一个具有不同半径的圆顶(或半球体)。有人告诉我如何在上一个问题上绘制 shpere:
[x,y,z] = sphere; %# Makes a 21-by-21 point sphere
x = x(11:end,:); %# Keep top 11 x points
y = y(11:end,:); %# Keep top 11 y points
z = z(11:end,:); %# Keep top 11 z points
r = 3; %# A radius value
surf(r.*x,r.*y,r.*z); %# Plot the surface
axis equal; %# Make the scaling on the x, y, and z axes equal
有谁知道如何在 MATLAB...或任何其他编程语言中绘制圆顶(又名半球体)?
但我需要 x、y 的高度和 z 分量都不同。
如何更改代码?
I need to plot a dome (or half sphere) that have different radii. I was told how to plot the shpere on a previous question:
[x,y,z] = sphere; %# Makes a 21-by-21 point sphere
x = x(11:end,:); %# Keep top 11 x points
y = y(11:end,:); %# Keep top 11 y points
z = z(11:end,:); %# Keep top 11 z points
r = 3; %# A radius value
surf(r.*x,r.*y,r.*z); %# Plot the surface
axis equal; %# Make the scaling on the x, y, and z axes equal
Does anyone know how to plot a dome (aka half sphere) in MATLAB...or anyother programming language?
But I need the height of the x, y, and z components to all be different.
How do I change the code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们将 x、y 和 z 的半径分别称为
rx
、ry
和rz
。然后你像这样调用该函数
Let's call the radius in x, y, and z
rx
,ry
, andrz
, respectively.Then you call the function like this