 returned and stored.</p>

<pre class="codeinput">
<span class="comment">% loop through the scan lines</span>
for scan_line_index = 1:number_scan_lines

    <span class="comment">% load the current section of the medium</span>
    medium.sound_speed = sound_speed_map(:, medium_position:medium_position + Ny - 1, :);
    medium.density = density_map(:, medium_position:medium_position + Ny - 1, :);
        
    <span class="comment">% run the simulation</span>
    sensor_data = kspaceFirstOrder3D(kgrid, medium