![]() |
如何在带有不同半径的MATLAB中绘制圆顶?
我需要绘制一个半径不同的圆顶(或半球形)。有人告诉我如何在上一个问题上画图:
[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 [URL="https://stackoverflow.com/questions/3603178/does-anyone-know-how-to-plot-a-dome-aka-half-sphere-in-matlab-or-anyother-pro"]有谁知道如何在MATLAB ...或任何其他编程语言中绘制圆顶(又称半球形)?[/URL] 但是我需要x,y和z分量的高度都不同。 如何更改代码? [B]回答:[/B] 让我们分别以x,y和z rx , ry和rz表示半径。 然后你这样调用函数 [x,y,z] = sphere; %# Makes a 21-by-21 point unit 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 rx = 3;ry = 4;rz = 9; %# Define rx, ry, rz surf(rx*x,ry*y,rz*z); %# Plot the surface, multiplying unit coordinates with radii axis equal; %# Make the scaling on the x, y, and z axes equal [url=https://stackoverflow.com/questions/3618294]更多&回答...[/url] |
所有时间均为北京时间。现在的时间是 01:05。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.