Hi ranzakhuss,
Sorry for the delay. I will try and answer your questions in turn.
1. If you open the k-Wave documentation (click on the blue question mark icon from the main MATLAB window and then select "k-Wave Toolbox" from the contents page), you can find detailed documentation for all of the k-Wave functions. If you select makeSphere
from the alphabetical list of functions, you can see what the different function inputs mean. You can also see this information from the command line by typing
>> help makeSphere
.
In this case, the first three inputs are the x, y, z size of the grid in units of grid points (or voxels). Try experimenting with makeSphere
using the same radius but different values for the grid size to see exactly what this does. You can plot the results using voxelPlot
.
2. In this particular example, the matrix that represents the transducer (assigned to the variable sphere
) is smaller than the overall grid size. The line you mention simply places the transducer into an empty sensor mask that has dimensions Nx
by Ny
by Nz
(it's a binary sensor mask in this case).
3. You can achieve this by moving the position of the source (assigned to source.mask
) and running multiple simulations. Take a look at the Modelling Sensor Directivity in 3D Example. If you mean dynamically moving the source within a single simulation, take a look at The Doppler Effect Example.
If you are going to be working with k-Wave a lot, it's probably a good idea to spend some time with the Initial Value Problem examples (even if this is not exactly what you want to simulate). These will introduce you to a lot of the general functionality of the toolbox.
Kind regards,
Brad.