事情对我来说很合适,但我不会使用符号j
作为变量,因为(如i
那样)它是虚构单元的符号(sqrt(-1)
)。这样做是为了覆盖它,因此事情将起作用,直到你不需要复杂的数字为止。
如果您的目标是按照元素组合数组条目,则应该使用基于元素的操作,例如(.*
),正如您正确获取F(\theta)
一样。实际上,cos(theta)
是包含在theta
等中的角度的余弦阵列。
最后,您可以使用命令Rotate 3D
在绘图窗口中旋转绘图。尽管如此,你有一条二维曲线(F(\theta)
),因此,你将继续旋转一个二维图形获得某种的透视图它,只不过是。要获得真正的信息,你需要一个额外的因变量(或者我误解了你的问题?)。
编辑:现在我明白你的意思,你希望周围的一些线,我想凭借对称Surface of revolution其中是theta=0
。那么,旋转表面可以通过一些解析几何图形来获得,并绘制成例如通过使用mesh
。检查了这一点:
% // 2D polar coordinate radius (your j)
Rad= (cos(theta)+1).*(besselj(1,const*sin(theta))./(const*sin(theta)));
Rad = abs(Rad); % // We need its absolute value for sake of clarity
xv = Rad .* cos(theta); % // 2D Cartesian coordinates
yv = Rad .* sin(theta); % // 2D Cartesian coordinates
phi = -pi:.01:pi; % // 3D revolution angle around theta = 0
% // 3D points of the surface
xf = repmat(xv',size(phi));
yf = yv' * cos(phi);
zf = yv' * sin(phi);
mesh(xf,yf,zf)
您还可以通过
mesh(xf,yf,zf,'FaceColor','interp','FaceLighting','phong')
camlight right
和更细的角度离散(1e-3)
添加图形效果
做到这一点。
我想得到像这样的东西http://imageshack.us/photo/my-images/818/3dplot.png/ – daredesm
@daredesm,我明白了你的观点,围绕哪一轴想要革命完成? 'theta = 0'? – Acorbe
@daredesm,请检查更新的答案。 – Acorbe