contourmode.m
来自「强大的计算电磁场本征函数与本征模的程序」· M 代码 · 共 37 行
M
37 行
function [cs,h] = contourmode(x,y,mode,maxm,dbsep,dbmax,t);
% Produces a contour plot (in dB) of the mode of an optical
% waveguide.
%
% USAGE:
%
% contourmode(x,y,mode,maxm,dbsep,dbmax,t);
% [cs,h] = contourmode(x,y,mode,maxm,dbsep,dbmax,t);
%
% INPUT:
%
% x,y - vectors describing horizontal and vertical grid points
% mode - the mode or field component to be plotted
% maxm - the field amplitude that should correspond to 0 dB.
% dbsep - separation between successive contours (in dB)
% dbmax - the smallest contour to plot (in dB)
% t - title of plot
%
% OUTPUT:
%
% cs - contour matrix
% h - handle to contourgroup object
x = real(x);
y = real(y);
mode = abs(transp(mode));
v = (0:-dbsep:-dbmax)';
[cs,h] = contour(x,y,20*log10(mode/maxm),v);
xlim([min(x),max(x)]);
ylim([min(y),max(y)]);
xlabel('x');
ylabel('y');
title(t);
v = axis;
set(gca,'PlotBoxAspectRatio',[v(2)-v(1) v(4)-v(3) 1]);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?