polar_plot_constant_phi.rar

  • Monkeies
    了解作者
  • matlab
    开发工具
  • 1KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 2
    下载次数
  • 2020-07-22 16:12
    上传日期
matlab FDTD 代码 已打包好,可以直接使用,theta角固定后的FDTD
polar_plot_constant_phi.rar
  • polar_plot_constant_phi.m
    3.1KB
内容介绍
function polar_plot_constant_phi(theta,pattern_1,pattern_2, ... max_val, step_size, number_of_rings,... line_style_1, line_style_2,constant_phi, ... legend_1,legend_2,scale_type) % this function plots two polar plots in the same figure plot_range = step_size * number_of_rings; min_val = max_val - plot_range; hold on; th = 0:(pi/50):2*pi; circle_x = cos(th); circle_y = sin(th); for mi = 1:number_of_rings r = (1/number_of_rings) * mi; plot(r*circle_x,r*circle_y,':','color','k','linewidth',1); text(0.04,r,[num2str(min_val+step_size*mi)],... 'verticalalignment','bottom','color','k',... 'fontweight','demi','fontsize',10); end r=[-1:0.1:1]; for mi = 3:8 th=mi*pi/6; plot(r*cos(th),r*sin(th),':','color','k','linewidth',1); text(1.1*cos(th),1.1*sin(th),[num2str(30*(mi-3))],... 'horizontalalignment','center','color','k',... 'fontweight','demi','fontsize',10); text(-1.1*cos(th),1.1*sin(th),[num2str(30*(mi-3))],... 'horizontalalignment','center','color','k',... 'fontweight','demi','fontsize',10); end text(0,-1.1,'180',... 'horizontalalignment','center','color','k',... 'fontweight','demi','fontsize',10); pattern_1(find(pattern_1 < min_val)) = min_val; pattern_1 = (pattern_1 - min_val)/plot_range; pattern_2(find(pattern_2 < min_val)) = min_val; pattern_2 = (pattern_2 - min_val)/plot_range; % transform data to Cartesian coordinates x1 = -pattern_1.*cos(theta+pi/2); y1 = pattern_1.*sin(theta+pi/2); x2 = -pattern_2.*cos(theta+pi/2); y2 = pattern_2.*sin(theta+pi/2); % plot data on top of grid p = plot(x1,y1,line_style_1,x2,y2,line_style_2,'linewidth',2); text(1.2*cos(pi/4),1.2*sin(pi/4),... ['\phi = ' num2str(constant_phi) '^o'],... 'color','b','fontweight','demi'); legend(p,legend_1,legend_2,'location','southeast'); text(-1, -1.1, scale_type,'fontsize',12); text(0.2,1.02,'®','fontname','symbol','color','b','fontweight','demi'); text(0.2, 1.08,'\theta','fontname','arial','color','b',... 'fontweight','demi','fontsize',12); text(-0.21,1.02,'\leftarrow','color','b','fontweight','demi'); text(-0.2, 1.08,'\theta','fontname','arial','color','b',... 'fontweight','demi','fontsize',12); if constant_phi == 0 text(1.2,0.06,'x','fontname','arial','color','b','fontweight','demi'); text(1.2,0,'®','fontname','symbol','color','b','fontweight','demi'); text(0.06,1.23,'z','fontname','arial','color','b','fontweight','demi'); text(0,1.23,'­','fontname','symbol','color','b','fontweight','demi'); text(1.2*cos(pi/4),1.18*sin(pi/4)-0.12,'xz plane',... 'color','b','fontweight','demi'); end if constant_phi == 90 text(1.2,0.06,'y','fontname','arial','color','b','fontweight','demi'); text(1.2, 0,'®','fontname','symbol','color','b','fontweight','demi'); text(0.06,1.23,'z','fontname','arial','color','b','fontweight','demi'); text(0,1.23,'­','fontname','symbol','color','b','fontweight','demi'); text(1.2*cos(pi/4),1.18*sin(pi/4)-0.12,'yz plane',... 'color','b','fontweight','demi'); end axis([-1.2 1.2 -1.2 1.2]); axis('equal');axis('off'); hold off; set(gcf,'PaperPositionMode','auto'); set(gca,'fontsize',12);
评论
    相关推荐
    • fdtd3D.rar
      fdtd 3D matlab版, c语言转成matlab代码,可运行
    • FDTD.zip
      这个文件主要用于FDTD运算方面,简单方便。
    • fdtd.rar
      fdtd的仿真程序,matlab编写,参考使用
    • fdtd3D.rar
      fdtd3维的仿真程序,matlab编写,参考使用
    • fdtd2D.rar
      fdtd2维的仿真程序,matlab编写,参考使用
    • fdtd1D.rar
      fdtd一维的仿真程序,matlab编写,参考使用
    • FDTD
      1维fdtd 计算 平面波入射等离子体
    • FDTD matlab 程序
      对做数值计算非常有用 这里有FDTD方法对二维光子晶体的数值模拟;PBGBand;FDTD_TM_PC;1D FDTD simulation;以及一些PDF文件
    • FDTD_matlab.rar
      使用matlab编写的二维FDTD算法,含部分重要问题讨论。
    • fdtd_matlab 源码
      fdtd方法的matlab,是taflove的Computational Electrodynamics: The Finite-Diff erence Time-Domain Method (Second Edition)的源码,包含1Dpml,2Dpml,3Dpml和3dupml。。