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

📄 create_spheres.m

📁 this a 3d fdtd code using matlab and it can be used as a reference for other structures. Dear sir,
💻 M
字号:
disp('creating spheres');

cx = fdtd_domain.cell_center_coordinates_x;
cy = fdtd_domain.cell_center_coordinates_y;
cz = fdtd_domain.cell_center_coordinates_z;

for ind=1:number_of_spheres
% distance of the centers of the cells from the center of the sphere
    distance = sqrt((spheres(ind).center_x - cx).^2 ...
            + (spheres(ind).center_y - cy).^2 ...
            + (spheres(ind).center_z - cz).^2);
    I = find(distance<=spheres(ind).radius);
    material_3d_space(I) = spheres(ind).material_type;
end
clear cx cy cz;

⌨️ 快捷键说明

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