三维空间任意位置绘制二维强度图, 上述使matlab代码,给出了U_slice123三个切片信息,以及一个三维等值面图,如何实现下图效果?
% 你的原始代码
N = 100;
c = 3e+8;
xbound = 400e-6;
tbound = 1.5e-12;
ybound = 400e-6;
w = 1;
t = linspace(tbound, -tbound, N);
x = linspace(xbound, -xbound, N);
y = linspace(-ybound, ybound, N); [T,X,Y] = meshgrid(t,x,y);
E1 = ((2*X/xbound)+1i*(2*T/tbound)).*exp(-((2*X/xbound).^2+...(2*Y/ybound).^2+(2*T/tbound).^2)/(w.^2));
II = abs(E1);%投影的话用U_slice
[~, t_index] = min(abs(t - 0));
U_slice1 = squeeze(II(t_index, :, :)); % 提取出 x-y 平面上对应位置的二维数