事情對我來說很合適,但我不會使用符號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