⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 show_pos.m

📁 利用电磁场的源激发方法来计算光子晶体波导例如光子晶体光纤
💻 M
字号:
function show_pos(oGd, pos)
% SHOW_POS(oGd, positions)
% Shows the positions of sources and testing points for geometry oGd and
% position coordinates positions.

hold off

iCurve = 1:length(pos.testing);
plot([pos.testing(iCurve).vX], [pos.testing(iCurve).vY], 'bx')
hold on
nSd = length(pos.sources);
vEr = zeros(1, nSd);
for iSd = 1:nSd
    if isnumeric(oGd.sdArray(iSd).Er)
        vEr(iSd) = oGd.sdArray(iSd).Er;
    else
        vEr(iSd) = base26(oGd.sdArray(iSd).Er);
    end
end
[vUniqueEr, indI, indJ] = unique(vEr);
nUnique = length(vUniqueEr);
map = equimap(nUnique);
for iUnique = 1:nUnique
    color = map(indJ(iUnique),:);
    iSd = find(indJ==iUnique);
    plot([pos.sources(iSd).vX], [pos.sources(iSd).vY], '.', 'Color', color)
end

axis equal
ax = axis;
axis(expand_axis(ax,1.1));
axis equal
sLegend = 'Testing Points';
for ind = 1:nUnique
    iSd = find(indJ==ind);
    if isnumeric(oGd.sdArray(iSd(1)).Er)
        sLegend = strvcat(sLegend, ['Sources for \epsilon_r =' ...
            num2str(vUniqueEr(ind)) ' region']);
    else
        sLegend = strvcat(sLegend, ['Sources for ' oGd.sdArray(iSd(1)).Er ...
            ' region']);
    end


end
draw_geom(oGd, 'noaxischange')

h = legend(sLegend, 'location', 'best');
fixfonts(h, 10);
axis equal

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -