XIAN-FEM-2026June/三维matlab代码/2023-2-端口激励问题(四面体网格)/波束包络/Plot2Dfield2.m

26 lines
837 B
Matlab
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function Plot2Dfield2(BMesh,modeNum,field,neff,figureNum,alpha)
for i=1:modeNum
xx=[BMesh.Nodes((BMesh.NewFaces(:,1)),1)';BMesh.Nodes((BMesh.NewFaces(:,2)),1)';...
BMesh.Nodes((BMesh.NewFaces(:,3)),1)'];
yy=[BMesh.Nodes((BMesh.NewFaces(:,1)),2)';BMesh.Nodes((BMesh.NewFaces(:,2)),2)';...
BMesh.Nodes((BMesh.NewFaces(:,3)),2)'];
zz=zeros(3,length(yy));
figure(figureNum);
h1=fill3(xx,yy,zz,field');
set(h1,'edgecolor','black','edgealpha',alpha);
shading interp %插值绘制
% axis equal; axis tight;
xlabel('X 单位m');
ylabel('Y 单位m');
titleStr=['第',num2str(figureNum),'个端口:','第',num2str(i),'个本征模式 normE neff=',num2str(neff(i))];
title(titleStr);
colorbar;
colormap jet;
caxis([min(field(:,i)) max(field(:,i))]);
end
end