-3
그리드 내부에 공이있는 3D 그리드를 만드는 함수를 작성하고 싶습니다. 3D이어야합니다. this example을 찾았는데 정확히 원하는 것입니다. 그러나이 파일을 함수 m- 파일에 어떻게 추가 할 수 있는지 전혀 알지 못합니다.Matlab : 3D 그리드를 만들려면 어떻게해야합니까?
이 내 코드입니다 :
function kgrid = makeGrid(Nx, dx, Ny, dy);
% create the computational grid
Nx = 64; % number of grid points in the x direction
Ny = 64; % number of grid points in the y direction
Nz = 64; % number of grid points in the z direction
dx = 0.1e-3; % grid point spacing in the x direction [m]
dy = 0.1e-3; % grid point spacing in the y direction [m]
dz = 0.1e-3; % grid point spacing in the z direction [m]
kgrid = makeGrid(Nx, dx, Ny, dy, Nz, dz);
end