beamlet3dfig09a.m

来自「beamlet变化的工具箱」· M 代码 · 共 69 行

M
69
字号
function Beamlet3Dfig09a(OpenNewWindow,HaveTitle)

if nargin<2
    HaveTitle=1;
end

if nargin<1
    OpenNewWindow=1;
end
if OpenNewWindow
    figure
end

ind=[5 1;21 1;5 21;28 21;5 25;21 25];
for k=1:6
     i=ind(k,1);
     s=ind(k,2);
     subplot(3,2,k);
     if s<17
         vertices=[0,0,-8;0,16,-8;16,16,-8;16,0,-8;0,0,24;0,16,24;16,16,24;16,0,24;0,0,0;0,16,0;...
              16,16,0;16,0,0;0,0,16;0,16,16;16,16,16;16,0,16];
     else
         vertices=[0,-8,0;0,-8,16;16,-8,16;16,-8,0;0,24,0;0,24,16;16,24,16;16,24,0;0,0,0;0,16,0;...
               16,16,0;16,0,0;0,0,16;0,16,16;16,16,16;16,0,16];
     end

     faces=[1,2,3,4;5,6,7,8;1,2,6,5;3,4,8,7;9,10,11,12;13,14,15,16;9,10,14,13;11,12,16,15];
     p=patch('faces',faces,'vertices',vertices,'facecolor','n','EdgeColor','b');
     axis image
     hold on
     if s<17
         [x,y]=meshgrid(0:16,0:16);
         z=(i/2)+(-1.125+s/8)*(8-y);
         m=mesh(x,y,z,~((z>=16)+(z<=0)),'FaceColor','flat','EdgeColor','r');
     else
         [x,z]=meshgrid(0:16,0:16);
         y=(i/2)+(3.125-s/8)*(8-z);
         m=mesh(x,y,z,~((y>=16)+(y<=0)),'FaceColor','flat','EdgeColor','r');

   
     end
     set(gca,'view',[-38,30]);
     colormap summer
     if HaveTitle
         ttlstr=strcat('b(:,:,',num2str(ind(k,1)),',',num2str(ind(k,2)),')');
         title(ttlstr) 
     end
     set(gca,'XTick',[],'YTick',[],'ZTick',[]);
     h=xlabel('x');
     set(h,'position',get(h,'position')+[7 11 0]);
     h=ylabel('y');
     set(h,'position',get(h,'position')+[10 12 0]);
     zlabel('z')
 end
 %% Part of BeamLab Version:200% Built:Friday,23-Aug-2002 00:00:00% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail beamlab@stat.stanford.edu%%% Part of BeamLab Version:200% Built:Saturday,14-Sep-2002 00:00:00% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail beamlab@stat.stanford.edu%

⌨️ 快捷键说明

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