matlab - 在matlab中绘制天线辐射特性

标签 matlab plot polar-coordinates bessel-functions

我需要绘制这个函数 enter image description here

theta = (-pi:0.01:pi);
f = 3*10^9;
c = 299792458;
da = 2;

这是我的代码,但我不确定它是否正确。我不知道点标记应该在哪里。如何设置X轴递减?

beta = (2*pi*f)/c;
const= (da*beta)/2; 
j= (cos(theta)+1).*(besselj(1,const*sin(theta))./(const*sin(theta)));

我的另一个问题是如何在极坐标中绘制此函数。

我做了这样的东西。

polar(theta,j);

是否可以旋转该函数(通过 y 轴)以获得 3D 绘图?

最佳答案

虽然我不会使用符号 j,但事情对我来说是正确的作为变量,因为(如 i 所做的那样)它是虚数单位 ( sqrt(-1) ) 的符号。这样做会覆盖它,因此事情会一直有效,直到您不需要复数。

当您打算逐个元素地组合数组条目时,您应该使用诸如 ( .* ) 之类的逐元素操作,就像您为获得 F(\theta) 所做的那样。 .事实上,cos(theta)theta 中包含的角度的余弦数组等等。

最后,您可以使用命令 Rotate 3D 旋转绘图在绘图窗口中。尽管如此,您有一个 2D 曲线 ( F(\theta) ),因此,您将继续旋转 2D 图形以获得它的某种透视图,仅此而已。要获得真实信息,您需要一个额外的因变量(或者我误解了您的问题?)。 enter image description here

编辑:现在我明白你的意思了,你想要 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)

enter image description here

还可以添加图形效果

enter image description here

这是通过

完成的
mesh(xf,yf,zf,'FaceColor','interp','FaceLighting','phong')
camlight right

和更精细的角度离散化 (1e-3) .

关于matlab - 在matlab中绘制天线辐射特性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14172204/

相关文章:

r - 使用 ggplots 或其他使用 R 的替代包修改极坐标图

linux - 您将如何在 WSL2 上运行的 ubuntu 中正确安装 MATLAB?

matlab - 解决 Matlab yyaxis 限制?

r - 如何画一个里面有双色粒子的 Crystal 球

python - 科学刻度标签符号调整

matlab - 使用 Matlab 2014b 的锯齿状轮廓

python - 带极轴的条形图

为最佳 "zigzag"配置文件选择一对向量的算法

matlab - 如何在 Matlab 中制作带有百分比值的混淆矩阵图

Matlab:如何在matlab中使用PCA找到可以丢弃数据集中的哪些变量?