This is my code
clear all
close all
% create the computational grid
Nx = 100; % number of grid points in the x (row) direction
Ny = 200; % number of grid points in the y (column) 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]
kgrid = kWaveGrid(Nx, dx, Ny, dy);
% define the properties of the upper layer of the propagation medium
medium.sound_speed_compression = 1500 * ones(Nx, Ny); % [m/s]
medium.sound_speed_shear = zeros(Nx, Ny); % [m/s]
medium.density = 1000 * ones(Nx, Ny); % [kg/m^3]
% define the properties of the lower layer of the propagation medium
medium.sound_speed_compression(Nx/2:end, :) = 2000; % [m/s]
medium.sound_speed_shear(Nx/2:end, :) = 800; % [m/s]
medium.density(Nx/2:end, :) = 1200; % [kg/m^3]
% create the time array
cfl = 0.05; % Courant-Friedrichs-Lewy number
t_end = 5e-6; % [s]
kgrid.makeTime(max(medium.sound_speed_compression(:)), cfl, t_end);
% define a source
source.s_mask = makeLine(Nx, Ny, [Nx/2,1],[1,Ny/2]);
%source.u_mask = makeLine(Nx, Ny, [Nx/2,1],[1,Ny/2]);
%create initial pressure distribution using makeDisc
disc_magnitude = 400; % [Pa]
source.p0 = disc_magnitude*source.s_mask ;
% define a time varying source
%source_freq = 1e6; % [Hz]
%source_mag = 0.00002;
%source.ux = source_mag * sin(2 * pi * source_freq * kgrid.t_array);
%source.uy = source_mag * sin(2 * pi * source_freq * kgrid.t_array);
%display_mask=source.u_mask;
sensor.mask=makeLine(Nx,Ny,[40,40],[60,60]);
% define input arguments
input_args = {'PlotScale', [-100, 100, -70, 70], 'PlotPML', false,...
'DisplayMask', sensor.mask, 'DataCast', 'single'};
% run the simulation
sensor_data = pstdElastic2D(kgrid, medium, source, sensor, input_args{:});
imagesc(sensor_data);
colormap(getColorMap);
colorbar;